Changeset 551


Ignore:
Timestamp:
07/14/08 15:57:48 (14 years ago)
Author:
ramonb
Message:

job_monarch/js/jobgrid.js:

  • add statusbar to clusterimage
  • added imageloader class
  • update statusbar loadmask when reloading clusterimage
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web2/addons/job_monarch/js/jobgrid.js

    r550 r551  
    116116}
    117117
     118function addListener(element, type, expression, bubbling)
     119{
     120  bubbling = bubbling || false;
     121  if(window.addEventListener)   { // Standard
     122    element.addEventListener(type, expression, bubbling);
     123    return true;
     124  } else if(window.attachEvent) { // IE
     125    element.attachEvent('on' + type, expression);
     126    return true;
     127  } else return false;
     128}
     129
     130var ImageLoader = function( id, url )
     131{
     132  this.url = url;
     133  this.image = document.getElementById( id );
     134  this.loadEvent = null;
     135};
     136
     137ImageLoader.prototype = {
     138  load:function(){
     139    var url = this.url;
     140    var image = this.image;
     141    var loadEvent = this.loadEvent;
     142    addListener(this.image, 'load', function(e){
     143      if(loadEvent != null){
     144        loadEvent(url, image);
     145      }
     146    }, false);
     147    this.image.src = this.url;
     148  },
     149  getImage:function(){
     150    return this.image;
     151  }
     152};
     153
    118154function reloadClusterImage()
    119155{
     
    122158  filt_url = makeArrayURL( myfilters );
    123159  imag_url = makeArrayURL( ClusterImageArgs );
    124 
    125   document.getElementById( 'clusterimage' ).src = './image.php?' + filt_url + '&' + imag_url;
     160  img_url = './image.php?' + filt_url + '&' + imag_url;
     161
     162  var newClusterImage = new ImageLoader( 'clusterimage', img_url );
     163  newClusterImage.loadEvent = function( url, image ) {ClusterImageWindow.getBottomToolbar().clearStatus({useDefaults:true});}
     164
     165  ClusterImageWindow.getBottomToolbar().showBusy();
     166  newClusterImage.load();
    126167}
    127168
     
    354395      resizable: false,
    355396      shadowOffset: 10,
    356       layout: 'fit'
     397      layout: 'fit',
     398      bbar: new Ext.StatusBar({
     399                defaultText: 'Ready.',
     400                id: 'basic-statusbar',
     401                defaultIconCls: ''
     402        })
     403
    357404    });
    358405
Note: See TracChangeset for help on using the changeset viewer.