Sha256: 741bd8ba8896b4c9795adc6265c12da768d976251abb50f5047dd2b3b8805561

Contents?: true

Size: 1.69 KB

Versions: 17

Compression:

Stored size: 1.69 KB

Contents

<script type="text/ng-template" id="promethee/components/image">
  <div ng-controller="ImageController" class="promethee-editor__component promethee-editor__component--image">
    <div class="promethee-editor__toolbar">
      Image
      <%= render 'promethee/partials/toolbar_buttons' %>
    </div>
    <div ng-show="editing" class="promethee-editor__wrapper">
      <div class="form-group">
        <label class="label-control">Url</label>
        <input ng-model="component.attributes.src" class="form-control" type="text"/>
      </div>
      <div class="form-group">
        <label class="label-control">Alt</label>
        <input ng-model="component.attributes.alt" class="form-control" type="text"/>
      </div>
    </div>
    <div ng-show="component.attributes.src">
      <img ng-click="edit()" ng-src="{{component.attributes.src}}" class="img-responsive">
    </div>
    <div ng-hide="component.attributes.src">
      <p ng-hide="editing" ng-click="edit()" class="text-center">Click to set the image</p>
    </div>
  </div>
</script>

<script type="text/ng-template" id="promethee/components/image/move">
  <img ng-src="{{component.attributes.src}}" class="img-responsive">
</script>

<script>
  angular.injector(['ng', 'Promethee']).get('definitions').push({
    name: 'Image',
    thumb: 'http://via.placeholder.com/300x200',
    data: {
      type: 'image',
      attributes: {
        src: 'https://source.unsplash.com/random/1920x1080'
      }
    }
  });

  promethee.controller('ImageController', ['$scope', function($scope) {

    $scope.editing = false;

    $scope.edit = function() {
      this.editing = true;
    };

    $scope.complete = function() {
      this.editing = false;
    };

  }]);
</script>

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
promethee-1.0.12 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.11 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.10 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.9 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.8 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.7 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.6 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.5 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.4 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.3 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.2 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.1 app/views/promethee/components/_image_edit.html.erb
promethee-1.0.0 app/views/promethee/components/_image_edit.html.erb
promethee-0.1.8 app/views/promethee/components/_image_edit.html.erb
promethee-0.1.7 app/views/promethee/components/_image_edit.html.erb
promethee-0.1.6 app/views/promethee/components/_image_edit.html.erb
promethee-0.1.5 app/views/promethee/components/_image_edit.html.erb