each box gets its own loading icon

This commit is contained in:
sanj 2011-01-11 22:47:37 +05:30
parent 085a68073e
commit e685fb4ef4

View File

@ -730,6 +730,7 @@ Ox.ItfBox = function(options, self) {
var $buttons = new Ox.Element().appendTo($title).css({'position': 'absolute', 'top': '1px', 'right': '1px'});
that.$loading = new Ox.LoadingIcon().appendTo($buttons);
var $infoBtn = new Ox.Button({
id: options.id + "InfoBtn",
style: 'symbold',
@ -814,6 +815,7 @@ Ox.ItfBox = function(options, self) {
return app.api.find(getQueryParams(data), callback)
},
'id': options.id + 'List',
'boxId': options.id,
/*
@ -855,7 +857,7 @@ Ox.ItfList = function(options, self) {
var self = self || {};
var that = new Ox.TextList(options, self);
that.bindEvent("select", function(e, data) {
app.$ui.previewBox.$loading.start();
app.$ui[options.boxId].$loading.start();
// debugger;
app.api.preview({
model: options.model,
@ -863,20 +865,20 @@ Ox.ItfList = function(options, self) {
id: data.ids[0]
}, function(response) {
// alert(JSON.stringify(response.data.data));
app.$ui.previewBox.$loading.stop();
app.$ui[options.boxId].$loading.stop();
var html = $.tmpl(response['template'], response['data']);
app.$ui.previewBox.$content.html(html);
});
});
that.bindEvent("open", function(e, data) {
// alert(JSON.stringify(data));
app.$ui.previewBox.$loading.start();
app.$ui[options.boxId].$loading.start();
app.api.info({
model: options.model,
module: options.module,
id: data.ids[0]
}, function(response) {
app.$ui.previewBox.$loading.stop();
app.$ui[options.boxId].$loading.stop();
var html = $.tmpl(response['template'], response['data']);
// alert(html);
var d = new Ox.Dialog({