From e685fb4ef43410db2dbec5c457d84fef668560ae Mon Sep 17 00:00:00 2001 From: sanj Date: Tue, 11 Jan 2011 22:47:37 +0530 Subject: [PATCH] each box gets its own loading icon --- itf/static/js/itf/itf.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/itf/static/js/itf/itf.js b/itf/static/js/itf/itf.js index 7c2b4ad..6174770 100644 --- a/itf/static/js/itf/itf.js +++ b/itf/static/js/itf/itf.js @@ -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({