"use strict"; /** * Created by viktor.shevchenko on 3/19/2015. */ (function () { 'use strict'; angular.module('knowledgeArticleModule') .directive('editKnowledgeArticleSection', ['localStorageService', function (localStorageService) { return { restrict: 'E', template: '
', scope: { options: '=', section: '=', articleUuid: '@' }, link: function (scope, element, attrs) { scope.state = { ready: false }; if (attrs.ignoreSectionOptions && scope.$eval(attrs.ignoreSectionOptions)) { scope.editorOptions = scope.options; } else { var sectionOptions = { title: scope.section.label, embeddedImageLimit: scope.section.embeddedImageLimit, filebrowserImageUploadUrl: '/smartit/rest/attachment/user/' + localStorageService.get('user.userId') + '/' + scope.articleUuid + '?section=' + encodeURIComponent(scope.section.name) }; scope.editorOptions = angular.extend({}, scope.options, sectionOptions); } scope.state.ready = true; } }; }]); }());