PATH:
home
/
letacommog
/
letaweb
/
admin
/
modules
/
menu
define(['module/base'],function(base) { return createModuleDefinition([base], function($window) { this.initializeData = { settings: { autoPlay:false, }, menu_items : [ {name : 'Home', link: '#'}, {name : 'About', link: '#'} ], dynamic:1 }; this.reloadMenu = function(template) { template = jQuery(template); var m = this.getElement().children('.main_menu_wrapper'); m.html(''); m.append(template.children()); m.children('ul.sm').smartmenus(); }; this.loadElement = function(el) { this._loadElement(el); var that = this; $(document).bind('page_menu_changed', function() { if(that.getData().dynamic) that.getModuleTemplate().then(function(template) { that.reloadMenu(template); }); }); }; this.controller = function($scope, $moduleInstance,$templateCache,$compile,iframeService,linkUtil) { $scope.data.speed_time = 100; $scope.createUrl = function( lnk) { return linkUtil.createUrl( lnk ); } $scope.changeAlign = function() { var ul = $moduleInstance.getElement().children().children('ul'); var a = ['left','right','center']; for(var i =0;i < a.length;i++) ul.removeClass('text-'+a[i]); ul.addClass('text-'+$scope.data.align); } var that = this; $scope.changeDynamic = function() { //if($scope.data.dynamic) $moduleInstance.getModuleTemplate().then(function(template) { $moduleInstance.reloadMenu(template); }); } $scope.changeRTL = function() { var ul = $moduleInstance.getElement().children().children('ul'); var cl="sm-rtl"; ul.removeClass(cl); if($scope.data.rtl==1) ul.addClass(cl); } $scope.changeVertical = function() { var ul = $moduleInstance.getElement().children().children('ul'); var cl="sm-vertical"; ul.removeClass(cl); if($scope.data.vertical==1) ul.addClass(cl); } $scope.onMenuChanged = function() { var template = '<ul ng-model="data.menu_items" class="sm">'+ '<li on-change="onChange()" ng-repeat="item in data.menu_items" ng-include="\'menu_recursiveTpl.html\'" category-draggable ng-model="item">' + '</li>'+ '</ul>'; var menu_recursiveTpl = '<a href="{{createUrl(item)}}">' + '{{item.name}}'+ '</a>' + '<ul >' + '<li ng-repeat="item in item.items" ng-include="\'menu_recursiveTpl.html\'" category-draggable ng-model="item">' + '</li>'+ '</ul>'; $templateCache.put('menu_recursiveTpl.html', menu_recursiveTpl); var menu_template = angular.element(template); $compile(menu_template)($scope); $moduleInstance.reloadMenu(menu_template); } $scope.$watch('data.menu_items', function(n,o) { if(n!= undefined && o != undefined) if($scope.data.dynamic!=1) $scope.onMenuChanged(); }, true); $scope.relativeUrl = getRelativeUrl(); window.EditMenuItemCtrl = function($scope, $dialog,communication) { }; }; }) });
[+]
..
[-] frontend_script.php
[edit]
[-] backend.php
[edit]
[-] backend.js
[edit]
[-] frontend_view.php
[edit]
[-] frontend_class.php
[edit]