dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15451
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5604: Visualizer gui bug fixed.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 5604 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-12-26 00:16:47 +0100
message:
Visualizer gui bug fixed.
modified:
dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js 2011-12-25 19:29:08 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js 2011-12-25 23:15:15 +0000
@@ -751,8 +751,9 @@
}
DV.util.mask.setMask(DV.cmp.favorite.window, 'Renaming...');
var r = DV.cmp.favorite.grid.getSelectionModel().getSelection()[0];
+ var url = DV.cmp.favorite.system.getValue() ? DV.conf.finals.ajax.favorite_addorupdatesystem : DV.conf.finals.ajax.favorite_addorupdate;
Ext.Ajax.request({
- url: DV.conf.finals.ajax.path_visualizer + DV.conf.finals.ajax.favorite_addorupdate,
+ url: DV.conf.finals.ajax.path_visualizer + url,
params: {uid: r.data.id, name: name},
success: function() {
DV.store.favorite.load({callback: function() {
@@ -2740,9 +2741,6 @@
DV.cmp.favorite.rename.label.setText('* Name already in use');
}
}
- else {
- DV.cmp.favorite.rename.label.setText('* No name entered');
- }
this.disable();
},
handler: function() {
@@ -2856,106 +2854,99 @@
}
}
],
- bbar: {
- cls: 'dv-toolbar',
- height: 29,
- defaults: {
- height: 24
- },
- items: [
- {
- xtype: 'label',
- style: 'padding-left:2px; line-height:22px; font-size:10px; color:#666; width:50%',
- listeners: {
- added: function() {
- DV.cmp.favorite.label = this;
- }
- }
- },
- '->',
- {
- text: 'Save',
- disabled: true,
- xable: function() {
- if (DV.state.isRendered) {
- if (DV.cmp.favorite.name.getValue()) {
- this.enable();
- DV.cmp.favorite.label.setText('');
- return;
- }
- else {
- DV.cmp.favorite.label.setText('');
- }
- }
- else {
- if (DV.cmp.favorite.name.getValue()) {
- DV.cmp.favorite.label.setText('* No active chart');
- }
- else {
- DV.cmp.favorite.label.setText('');
- }
- }
- this.disable();
- },
- handler: function() {
- var value = DV.cmp.favorite.name.getValue();
- if (DV.state.isRendered && value) {
- if (DV.store.favorite.findExact('name', value) != -1) {
- var item = value.length > 40 ? (value.substr(0,40) + '...') : value;
- var w = Ext.create('Ext.window.Window', {
- title: 'Save favorite',
- width: DV.conf.layout.window_confirm_width,
- bodyStyle: 'padding:10px 5px; background-color:#fff; text-align:center',
- modal: true,
- items: [
- {
- html: 'Are you sure?',
- bodyStyle: 'border-style:none'
- },
- {
- html: '<br/>' + item,
- cls: 'dv-window-confirm-list'
- }
- ],
- bbar: [
- {
- text: 'Cancel',
- handler: function() {
- DV.cmp.favorite.window.close();
- }
- },
- '->',
- {
- text: 'Overwrite',
- handler: function() {
- this.up('window').close();
- DV.util.crud.favorite.update(function() {
- DV.cmp.favorite.window.resetForm();
- });
-
- }
- }
- ]
- });
- w.setPosition((screen.width/2)-(DV.conf.layout.window_confirm_width/2), DV.conf.layout.window_favorite_ypos + 100, true);
- w.show();
- }
- else {
- DV.util.crud.favorite.create(function() {
- DV.cmp.favorite.window.resetForm();
- DV.cmp.favorite.window.down('grid').setHeightInWindow(DV.store.favorite);
- });
- }
- }
- },
- listeners: {
- added: function() {
- DV.cmp.favorite.save = this;
- }
- }
- }
- ]
- },
+ bbar: [
+ {
+ xtype: 'label',
+ style: 'padding-left:2px; line-height:22px; font-size:10px; color:#666; width:50%',
+ listeners: {
+ added: function() {
+ DV.cmp.favorite.label = this;
+ }
+ }
+ },
+ '->',
+ {
+ text: 'Save',
+ disabled: true,
+ xable: function() {
+ if (DV.state.isRendered) {
+ if (DV.cmp.favorite.name.getValue()) {
+ this.enable();
+ DV.cmp.favorite.label.setText('');
+ return;
+ }
+ else {
+ DV.cmp.favorite.label.setText('');
+ }
+ }
+ else {
+ if (DV.cmp.favorite.name.getValue()) {
+ DV.cmp.favorite.label.setText('* The example chart cannot be saved');
+ }
+ else {
+ DV.cmp.favorite.label.setText('');
+ }
+ }
+ this.disable();
+ },
+ handler: function() {
+ var value = DV.cmp.favorite.name.getValue();
+ if (DV.state.isRendered && value) {
+ if (DV.store.favorite.findExact('name', value) != -1) {
+ var item = value.length > 40 ? (value.substr(0,40) + '...') : value;
+ var w = Ext.create('Ext.window.Window', {
+ title: 'Save favorite',
+ width: DV.conf.layout.window_confirm_width,
+ bodyStyle: 'padding:10px 5px; background-color:#fff; text-align:center',
+ modal: true,
+ items: [
+ {
+ html: 'Are you sure?',
+ bodyStyle: 'border-style:none'
+ },
+ {
+ html: '<br/>' + item,
+ cls: 'dv-window-confirm-list'
+ }
+ ],
+ bbar: [
+ {
+ text: 'Cancel',
+ handler: function() {
+ DV.cmp.favorite.window.close();
+ }
+ },
+ '->',
+ {
+ text: 'Overwrite',
+ handler: function() {
+ this.up('window').close();
+ DV.util.crud.favorite.update(function() {
+ DV.cmp.favorite.window.resetForm();
+ });
+
+ }
+ }
+ ]
+ });
+ w.setPosition((screen.width/2)-(DV.conf.layout.window_confirm_width/2), DV.conf.layout.window_favorite_ypos + 100, true);
+ w.show();
+ }
+ else {
+ DV.util.crud.favorite.create(function() {
+ DV.cmp.favorite.window.resetForm();
+ DV.cmp.favorite.window.down('grid').setHeightInWindow(DV.store.favorite);
+ });
+ }
+ }
+ },
+ listeners: {
+ added: function() {
+ DV.cmp.favorite.save = this;
+ }
+ }
+ }
+ ],
listeners: {
show: function() {
DV.cmp.favorite.save.xable();