[icinga-checkins] icinga.org: icinga-web/master: Icon bugfix for cronk builder, refs #3245

git at icinga.org git at icinga.org
Tue Oct 9 16:58:05 CEST 2012


Module: icinga-web
Branch: master
Commit: b2470ea24461c75e02946913ee4aa88ca6430f40
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=b2470ea24461c75e02946913ee4aa88ca6430f40

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Oct  9 16:54:16 2012 +0200

Icon bugfix for cronk builder, refs #3245

---

 .../Cronks/lib/js/Cronk/util/CronkBuilder.js       |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/app/modules/Cronks/lib/js/Cronk/util/CronkBuilder.js b/app/modules/Cronks/lib/js/Cronk/util/CronkBuilder.js
index 51ed02a..f504792 100644
--- a/app/modules/Cronks/lib/js/Cronk/util/CronkBuilder.js
+++ b/app/modules/Cronks/lib/js/Cronk/util/CronkBuilder.js
@@ -543,8 +543,6 @@ Ext.ns("Cronk.util.CronkBuilder");
                 
                 var form = this.formPanel.getForm();
                 
-                // AppKit.log(this.cronkCmp, this.cronk);
-                
                 form.findField('name').setValue(this.cronkCmp.title);
                 form.findField('cid').setValue(Ext.id(null, 'CUSTOM-' + this.cronk.crname));    
                 form.findField('module').setValue(this.cronk.params.module);
@@ -586,6 +584,12 @@ Ext.ns("Cronk.util.CronkBuilder");
                 o.image_id = o.image;
             }
             
+            // The combo needs a image id to work properly
+            if (o.image_id.match(/\/(\w+)\.\w{1,5}$/)) {
+                o.image_id = RegExp.$1;
+                o.image_id = 'cronks.' + o.image_id;
+            }
+            
             // Event driven because of hidden categories after edit
             this.categories.on('load', function() {
                 var f = this.formPanel.getForm();
@@ -599,6 +603,7 @@ Ext.ns("Cronk.util.CronkBuilder");
                 f.findField('state').setValue(o.state);
                 
                 f.findField('categories').setValue(o.categories);
+                
                 f.findField('image').setValue(o.image_id);
                 
                 if (!Ext.isEmpty(o.groupsonly)) {
@@ -636,7 +641,7 @@ Ext.ns("Cronk.util.CronkBuilder");
                 panel.getEl().last().remove();
             }
             
-            var index = this.iconCombo.getStore().findExact('web_path', this.iconCombo.getValue());
+            var index = this.iconCombo.getStore().findExact('short', this.iconCombo.getValue());
             
             if (index>=0) {
                 var record = this.iconCombo.getStore().getAt(index);





More information about the icinga-checkins mailing list