From 085a68073e1a194c006b778f94f3b1db45f61d96 Mon Sep 17 00:00:00 2001 From: sanj Date: Tue, 11 Jan 2011 22:37:10 +0530 Subject: [PATCH] test loading icon --- itf/static/js/itf/itf.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/itf/static/js/itf/itf.js b/itf/static/js/itf/itf.js index 8ac3b7e..7c2b4ad 100644 --- a/itf/static/js/itf/itf.js +++ b/itf/static/js/itf/itf.js @@ -656,10 +656,10 @@ BEGIN mainPanel 'previewBox': function() { var id = 'previewBox'; - var c = app.$ui[id] = new Ox.Element({ + var c = app.$ui[id] = new Ox.ItfPreview({ id: id }); - c.html("previews here"); + c.$content.html("previews here"); return c; }, @@ -855,23 +855,28 @@ 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(); +// debugger; app.api.preview({ model: options.model, module: options.module, id: data.ids[0] }, function(response) { // alert(JSON.stringify(response.data.data)); + app.$ui.previewBox.$loading.stop(); var html = $.tmpl(response['template'], response['data']); - app.$ui.previewBox.html(html); + app.$ui.previewBox.$content.html(html); }); }); that.bindEvent("open", function(e, data) { // alert(JSON.stringify(data)); + app.$ui.previewBox.$loading.start(); app.api.info({ model: options.model, module: options.module, id: data.ids[0] }, function(response) { + app.$ui.previewBox.$loading.stop(); var html = $.tmpl(response['template'], response['data']); // alert(html); var d = new Ox.Dialog({ @@ -904,6 +909,13 @@ Ox.ItfCalendar = function(options, self) { return that; } +Ox.ItfPreview = function(options, self) { + var self = self || {}; + var that = new Ox.Element(options, self); + that.$content = new Ox.Element().appendTo(that); + that.$loading = new Ox.LoadingIcon().appendTo(that); + return that; +} ITF.templates = {};