Sha256: 806e728b412accab4227ae5181a4924e8197c74c0611e1cdb769f7d07c02e3ae

Contents?: true

Size: 1.29 KB

Versions: 2

Compression:

Stored size: 1.29 KB

Contents

<script type="text/ng-template" id="promethee/write/component/text">
  <div  ng-controller="TextController"
        class="promethee-editor__component promethee-editor__component--text">
    <div class="promethee-editor__toolbar">
      Text
      <ng-include src="'promethee/write/toolbar'"></ng-include>
    </div>
    <div ng-show="editing">
      <summernote config="options" ng-model="component.attributes.body"></summernote>
    </div>
    <div ng-hide="editing">
      <div class="promethee-editor__wrapper" ng-bind-html="component.attributes.body | htmlSafe" ng-click="edit()"></div>
    </div>
  </div>
</script>

<script>
  angular.injector(['ng', 'Promethee']).get('definitions').push({
    name: 'Text',
    thumb: 'http://via.placeholder.com/300x200',
    data: {
      type: 'text',
      attributes: {
        body: 'Edit me'
      }
    }
  });

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

    $scope.editing = false;

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

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

    $scope.options = {
      toolbar: [
        ['headline', ['style']],
        ['style', ['bold', 'italic']],
        ['alignment', ['ul', 'ol', 'paragraph']],
        ['code', ['codeview']]
      ]
    };

  }]);
</script>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
promethee-1.0.15 app/views/promethee/edit/write/component/_text.html.erb
promethee-1.0.14 app/views/promethee/edit/write/component/_text.html.erb