Skip to content

Commit

Permalink
EZP-24157: Expose the eZAutoSubmit object in Y.Global
Browse files Browse the repository at this point in the history
  • Loading branch information
dpobel committed Mar 30, 2015
1 parent 8e30e00 commit 2fb989f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions design/standard/javascript/ezautosubmit.js
Expand Up @@ -78,7 +78,8 @@ YUI(YUI3_config).add('ezautosubmit', function (Y) {
*/
function eZAutoSubmit(conf) {
var that = this,
enableCheckFunc = conf.enabled || function () { return true; };
enableCheckFunc = conf.enabled || function () { return true; },
form;

this.conf = Y.merge(defaultConfig, conf);
this.conf.interval = parseInt(this.conf.interval);
Expand All @@ -88,9 +89,10 @@ YUI(YUI3_config).add('ezautosubmit', function (Y) {
this.timer = false;
this.started = false;
this.state = '';
form = Y.one(this.conf.form);
this.ajaxConfiguration = {
form:{
id: Y.one(this.conf.form),
id: form,
upload: true
},
method: 'POST'
Expand All @@ -108,6 +110,9 @@ YUI(YUI3_config).add('ezautosubmit', function (Y) {
Y.on('autosubmit:forcesave', function () {
that.submit('AutoSubmitForced=' + new Date().getTime());
});

Y.Global.Autosave = Y.Global.Autosave || {};
Y.Global.Autosave[form.get('id')] = this;
}

/**
Expand Down

0 comments on commit 2fb989f

Please sign in to comment.