PATH:
home
/
letacommog
/
letaweb
/
admin
/
modules
/
alert
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.editAlert = function(index) { $scope.data.alerts[index].edit_mode = true; } $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); } }; }) });
[+]
..
[-] backend.js
[edit]
[-] frontend_class.php
[edit]
[-] backend.php
[edit]
[-] frontend_view.php
[edit]