comparison app/view/widget/base/FieldSet.js @ 720:c2a6f7caa71b

Fix for ErrorMessages in FieldSets for IE8 IE9
author Dustin Demuth <dustin@intevation.de>
date Wed, 15 Apr 2015 18:34:23 +0200
parents f124d24c8ade
children 36c2cd8d6c54
comparison
equal deleted inserted replaced
719:5e91a740aff8 720:c2a6f7caa71b
16 warningText: '', 16 warningText: '',
17 tooltip: null, 17 tooltip: null,
18 18
19 showWarningOrError: function(warning, warningText, error, errorText) { 19 showWarningOrError: function(warning, warningText, error, errorText) {
20 this.clearMessages(); //Clear Errors and Warning first 20 this.clearMessages(); //Clear Errors and Warning first
21 var ndx = 0;
22 if (this.collapsible === true) {
23 ndx = 1;
24 }
25 if (this.errorText && this.errorText !== '') { 21 if (this.errorText && this.errorText !== '') {
26 this.errorText += '\n'; 22 this.errorText += '\n';
27 } 23 }
28 this.errorText += errorText; 24 this.errorText += errorText;
29 if (this.warningText && this.warningText !== '') { 25 if (this.warningText && this.warningText !== '') {
30 this.warningText += '\n'; 26 this.warningText += '\n';
31 } 27 }
32 this.warningText += warningText; 28 this.warningText += warningText;
33 this.plainTitle = this.getEl().dom.firstChild 29 this.plainTitle = this.title;
34 .firstChild.firstChild
35 .children[ndx].innerHTML;
36 this.origColor = this.getEl().dom.style['border-color']; 30 this.origColor = this.getEl().dom.style['border-color'];
31 var imgId = Ext.id();
37 if (error) { 32 if (error) {
38 this.getEl().dom.style['border-color'] = '#FF0000'; 33 this.getEl().dom.style['border-color'] = '#FF0000';
39 this.getEl().dom.firstChild.firstChild.firstChild 34 this.setTitle('<img src="resources/img/emblem-important.png" width="13" height="13" id="'+ imgId +'"/> '+
40 .children[ndx].innerHTML = 35 this.plainTitle);
41 '<img src="resources/img/emblem-important.png" width="13" height="13" /> ' +
42 this.plainTitle;
43 if (errorText) { 36 if (errorText) {
44 if (!this.tooltip) { 37 if (!this.tooltip) {
45 Ext.create('Ext.tip.ToolTip', { 38 Ext.create('Ext.tip.ToolTip', {
46 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx], 39 target: imgId,
47 html: errorText 40 html: errorText
48 }); 41 });
49 } 42 }
50 else { 43 else {
51 tooltip.html = errorText; 44 tooltip.html = errorText;
53 } 46 }
54 return; 47 return;
55 } 48 }
56 if (warning) { 49 if (warning) {
57 this.getEl().dom.style['border-color'] = '#FFE25D'; 50 this.getEl().dom.style['border-color'] = '#FFE25D';
58 this.getEl().dom.firstChild.firstChild.firstChild 51 this.setTitle('<img src="resources/img/dialog-warning.png" width="13" height="13" id="'+ imgId +'"/> '+
59 .children[ndx].innerHTML = 52 this.plainTitle);
60 '<img src="resources/img/dialog-warning.png" width="13" height="13" /> ' +
61 this.plainTitle;
62 if (warningText) { 53 if (warningText) {
63 if (!this.tooltip) { 54 if (!this.tooltip) {
64 Ext.create('Ext.tip.ToolTip', { 55 Ext.create('Ext.tip.ToolTip', {
65 target: this.getEl().dom.firstChild.firstChild.firstChild.children[ndx], 56 target: Ext.get(imgId),
66 html: warningText 57 html: warningText
67 }); 58 });
59 debugger;
68 } 60 }
69 else { 61 else {
70 tooltip.html = warningText; 62 tooltip.html = warningText;
71 } 63 }
72 } 64 }
73 return; 65 return;
74 } 66 }
75 }, 67 },
76 68
77 clearMessages: function() { 69 clearMessages: function() {
78 var ndx = 0;
79 if (this.collapsible === true) {
80 ndx = 1;
81 }
82 if (this.plainTitle !== '') { 70 if (this.plainTitle !== '') {
83 this.getEl().dom.firstChild 71 this.setTitle(this.plainTitle);
84 .firstChild.firstChild
85 .children[ndx].innerHTML = this.plainTitle;
86 this.getEl().dom.style['border-color'] = this.origColor; 72 this.getEl().dom.style['border-color'] = this.origColor;
87 } 73 }
88 } 74 }
89 }); 75 });

http://lada.wald.intevation.org