PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
modules
define(['module/base'],function(base) { return createModuleDefinition([base], function($window) { this.initializeData = { texts:[ {label:'Well done! You successfully read this important alert message. '}, {label:'Heads up! This alert needs your attention, but it\'s not super important.'} ], prefix_text:'Before', postfix_text:'After', settings : { speed: 700, pause: 4000, showItems: 1, height: 0, margin: 0, padding: 0, } }; this.getState = function() { return jQuery('#' + this.page_id + '_vticker').data('state'); }; this.controller = function($scope, $moduleInstance) { var state = $moduleInstance.getState(); var vtickerEl = jQuery('#' + $moduleInstance.page_id + '_vticker'); $scope.animating = state.animating; vtickerEl.unbind("vticker.beforeTick"); vtickerEl.bind("vticker.beforeTick", function() { $scope.animating = true; $scope.$digest(); }); vtickerEl.unbind("vticker.afterTick"); vtickerEl.bind("vticker.afterTick", function() { $scope.animating = false; $scope.$digest(); }); $scope.editText = function(index) { getElement(index); $scope.data.texts[index].edit_mode = 1; } var getElement = function(index) { var state = $moduleInstance.getState(); if(state.topIndex!= undefined) { var topIndex = state.topIndex % state.itemCount; var realIndex = (index - topIndex) < 0 ? (state.itemCount + index - topIndex) : (index - topIndex); // console.log(state.itemCount,realIndex); //console.log(vtickerEl.children('ul').children('li').eq( realIndex)); return (vtickerEl.children('ul').children('li').eq( realIndex)); } } $scope.changeLabel = function(index) { if($scope.animating) return; var label = $scope.data.texts[index].label; var el = getElement(index); if(el != undefined) el.html(label); } $scope.deleteText = function(index) { if($scope.animating) return; $scope.data.texts.splice(index,1); var alertElement = $moduleInstance.getElement().children().children('.alert:eq('+index+')'); alertElement.remove(); console.log(alertElement); } $scope.addText = function() { if($scope.animating) return; var state = $moduleInstance.getState(); var p = {icon:'fa fa-info-circle',label:'New Text.'}; $scope.data.texts.push(p); var pb = jQuery('<li/>').html(p.label); var el = getElement($scope.data.texts.length - 2); //state.itemCount = $scope.data.texts.length; if(el != undefined) { el.after(pb); resetTicker(); } } $scope.changePostfix = function() { var postElement = vtickerEl.next('span'); postElement.html($scope.data.postfix_text) } $scope.changePrefix = function() { var preElement = vtickerEl.prev('span'); preElement.html($scope.data.prefix_text) } $scope.changeSettings = function() { resetTicker(); } var resetTicker = function() { var state = $moduleInstance.getState(); vtickerEl.vTicker({topIndex: state.topIndex % state.itemCount, showItems: $scope.data.settings.showItems,speed: $scope.data.settings.speed, pause: $scope.data.settings.pause}); } }; }) });
[+]
..
[-] 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]