Sha256: 37f7821fe00e4ac708c74b9ef2aa24082a92066257ef46f2ac72c346552e21bb

Contents?: true

Size: 1.51 KB

Versions: 24

Compression:

Stored size: 1.51 KB

Contents

<script type="text/ng-template" id="promethee/components/slider/edit/inspect">
  <div ui-sortable ng-model="promethee.inspected.children">
    <div
      class="panel panel-default"
      ng-repeat="component in promethee.inspected.children"
    >
      <div class="panel-body">
        <div class="row">
          <div class="col-xs-9">
            <span class="label label-default">#{{$index + 1}}</span>
            <span class="label label-info">{{component.type}}</span>
          </div>
          <div class="col-xs-3">
            <ng-include src="'promethee/move/component'"></ng-include>
          </div>
        </div>
      </div>
    </div>
  </div>

  <div class="pull-right btn-toolbar" ng-controller="SliderInspectorController">
    <span ng-repeat="definition in itemDefinitions" class="btn btn-default" ng-click="addItem(definition)">Add {{definition.name}}</span>
  </div>
</script>

<script>
  promethee.controller('SliderInspectorController', ['$scope', 'identifier', function($scope, identifier) {
    var availableComponents = ['image', 'video'];

    $scope.itemDefinitions = $scope.promethee.definitions.filter(function(definition) {
      return availableComponents.includes(definition.data.type);
    });

    var clone = function(object) {
      return JSON.parse(JSON.stringify(object));
    }

    $scope.addItem = function(definition) {
      var item = JSON.parse(JSON.stringify(definition.data));
      item.id = identifier.generate();

      $scope.promethee.inspected.children.push(item);
    }
  }])
</script>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
promethee-1.4.1 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.4.0 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.26 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.25 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.24 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.23 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.22 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.21 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.20 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.19 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.18 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.17 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.16 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.15 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.13 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.12 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.11 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.10 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.9 app/views/promethee/components/slider/_edit.inspect.html.erb
promethee-1.3.7 app/views/promethee/components/slider/_edit.inspect.html.erb