Sha256: 956855d2b876085d6a99f2431c9129cc73e2cdd44447b872e17eff74899439e9

Contents?: true

Size: 1.65 KB

Versions: 18

Compression:

Stored size: 1.65 KB

Contents

Ext.define("Compass.ErpApp.Shared.UploadWindow",{
  extend:"Ext.window.Window",
  alias:'widget.erpappshared_uploadwindow',

  initComponent: function() {
    this.callParent(arguments);
    this.addEvents(
      /*** @event fileuploaded
         * Fired after file is uploaded.
         * @param {Compass.ErpApp.Shared.UploadWindow } uploadWindow This object
         */
      'fileuploaded'
      );
  },

  constructor : function(config) {
    if(Compass.ErpApp.Utility.isBlank(config)){
      config = {};
    }
    var self = this;

    config.extraPostData = Ext.applyIf({authenticity_token:Compass.ErpApp.AuthentictyToken}, config.extraPostData);
    query_string = '?' + Ext.Object.toQueryString(config.extraPostData);

    if (typeof ErpTechSvcs.Config.max_file_size_in_mb == 'number'){
      max_file_size = ErpTechSvcs.Config.max_file_size_in_mb + 'mb'
    }else{
      max_file_size = ErpTechSvcs.Config.max_file_size_in_mb
    }

    this.plUploader = Ext.create("Ext.ux.panel.UploadPanel",{
      region:'center',
      url: (config.standardUploadUrl || './file_manager/base/upload_file') + query_string,
      max_file_size: max_file_size,
      listeners:{
        scope:this,
        'uploadcomplete':function(pluploader, success, failed){
          if(success){


            this.fireEvent('fileuploaded', this);
            self.close();
          }else{
            return false;
          }
        }
      }
    });

    config = Ext.apply({
      title:'File Upload',
      layout:'border',
      autoWidth:true,
      height:300,
      width:800,
      iconCls:'icon-upload',
      items:[this.plUploader]
    }, config);

    this.callParent([config]);
  }

});

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
erp_app-4.0.0 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.16 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.15 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.14 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.13 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.12 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.11 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.10 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.9 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.8 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.7 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.6 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.5 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.4 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.3 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.2 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.1 public/javascripts/erp_app/shared/file_upload/upload_window.js
erp_app-3.1.0 public/javascripts/erp_app/shared/file_upload/upload_window.js