PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
modules
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) { }; }; }) });
[+]
..
[-] productlist.js
[edit]
[-] facebookvideo.js
[edit]
[-] newslist.js
[edit]
[-] image.js
[edit]
[-] video.js
[edit]
[-] button.js
[edit]
[-] zone.js
[edit]
[-] text.js
[edit]
[-] newscategory.js
[edit]
[-] googlemap.js
[edit]
[-] base_structure.js
[edit]
[-] contactform.js
[edit]
[-] spacer.js
[edit]
[-] infobox.js
[edit]
[-] html.js
[edit]
[-] testmodule.js
[edit]
[-] facebookcomment.js
[edit]
[-] iframe.js
[edit]
[-] twitterfeed.js
[edit]
[-] recentnews.js
[edit]
[-] audio_player.js
[edit]
[-] slick.js
[edit]
[-] newsdetail.js
[edit]
[-] facebookpost.js
[edit]
[-] pagezone.js
[edit]
[-] panigation.js
[edit]
[-] row.js
[edit]
[-] __custom_module_template.js
[edit]
[-] carousel.js
[edit]
[-] icon.js
[edit]
[-] typedtext.js
[edit]
[-] newscomment.js
[edit]
[-] box.js
[edit]
[-] base_custom.js
[edit]
[-] wordpress.js
[edit]
[-] base.js
[edit]
[-] column.js
[edit]
[-] fancytext.js
[edit]
[-] recentproduct.js
[edit]
[-] statcounter.js
[edit]
[-] tab.js
[edit]
[-] bootstrap_slider.js
[edit]
[-] ihover.js
[edit]
[-] line.js
[edit]
[-] blogger.js
[edit]
[-] slideshow.js
[edit]
[-] title.js
[edit]
[-] facebookpage.js
[edit]
[-] share_buttons.js
[edit]
[-] facebooklike.js
[edit]
[-] infobanner.js
[edit]
[-] rssfeed.js
[edit]
[-] flash.js
[edit]
[-] countdown.js
[edit]
[-] facebooksend.js
[edit]
[-] mailchimp.js
[edit]
[-] infotable.js
[edit]
[-] navbar.js
[edit]
[-] cycleslider.js
[edit]
[-] modal.js
[edit]
[-] embed.js
[edit]
[-] alert.js
[edit]
[-] progress_bar.js
[edit]
[-] accordion.js
[edit]
[-] youtube.js
[edit]
[-] social_buttons.js
[edit]
[-] productcategory.js
[edit]
[-] menu.js
[edit]
[-] pricetable.js
[edit]
[-] productdetail.js
[edit]
[-] gallery.js
[edit]