/** * system effects dialog */ define([ 'jquery', 'app/init', 'app/util', 'app/render', 'bootbox', 'app/map/util' ], function($, Init, Util, Render, bootbox, MapUtil) { 'use strict'; var config = { // system effect dialog systemEffectDialogWrapperClass: 'pf-system-effect-dialog-wrapper' // class for system effect dialog }; var cache = { systemEffectDialog: false // system effect info dialog }; /** * show system effect dialog */ $.fn.showSystemEffectInfoDialog = function(){ // cache table structure if(!cache.systemEffectDialog){ var dialogWrapperElement = $('
| ').html( ' ' + systemEffectName).prepend( $('', { class: ['fa', 'fa-square', 'fa-fw', systemEffectClass].join(' ') }) ) ); } rows[0].append( $(' | ', { class: ['text-right', 'col-xs-1', securityClass].join(' ') }).text( systemType )); $.each( areaData, function( i, data ) { if(areaId === '1'){ rows.push( $(' |
| ').text( data.effect )); } rows[i + 1].append( $(' | ', { class: 'text-right' }).text( data.value )); }); }); dialogWrapperElement.append( table.append( thead ).append( tbody ) ); cache.systemEffectDialog = dialogWrapperElement; }); } bootbox.dialog({ title: 'System effect information', message: cache.systemEffectDialog }); }; }); |