PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
modules
define(['module/base'],function(base) { return createModuleDefinition([base], function($window) { this.initializeData = { alerts:[ {has_icon:0,icon:'fa fa-info-circle',label:'Well done! You successfully read this important alert message. '}, {has_icon:0,icon:'fa fa-info-circle',label:'Heads up! This alert needs your attention, but it\'s not super important.'} ] }; this.controller = function($scope, $moduleInstance) { $scope.editting = -1; $scope.editAlert = function(index) { $scope.editting = index; } $scope.changeLabel = function(index) { var label = $scope.data.alerts[index].label; var alertElement = $moduleInstance.getElement().children().children('.alert:eq('+index+')'); alertElement.find('p').html(label); } $scope.changeIcon = function(index) { var has_icon = $scope.data.alerts[index].has_icon; var alertElement = $moduleInstance.getElement().children().children('.alert:eq('+index+')'); if(has_icon==0) { //$scope.data.alerts[index].icon=''; alertElement.removeClass('alert-with-icon'); } else { var icon = $scope.data.alerts[index].icon; alertElement.addClass('alert-with-icon'); jQuery('.icon',alertElement).find('i').attr('class',icon); } } $scope.deleteAlert = function(index) { $scope.data.alerts.splice(index,1); var alertElement = $moduleInstance.getElement().children().children('.alert:eq('+index+')'); alertElement.remove(); console.log(alertElement); } $scope.addAlert = function() { var p = {has_icon:0,icon:'fa fa-info-circle',label:'Well done! You successfully read this important alert message.'}; $scope.data.alerts.push(p); var pb = jQuery('<div class="alert"/>').html('<div class="icon"><i></i></div><p>'+p.label+'</p>'); $moduleInstance.getElement().children().append(pb); } }; }) });
[+]
..
[-] 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]