fix(edit) showMessage: mv style to load

This commit is contained in:
coderaiser 2014-06-11 03:48:11 -04:00
parent f333cd8061
commit 0f038a38d7

View file

@ -429,6 +429,21 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
Util.timeEnd(Name + ' load');
Util.exec(callback);
});
DOM.load.style({
id : 'msg-css',
inner : '#js-view .msg {' +
'z-index' + ': 1;' +
'background-color' + ': #7285B7;' +
'color' + ': #D1F1A9;' +
'position' + ': fixed;' +
'left' + ': 40%;' +
'top' + ': 25px;' +
'padding' + ': 5px;' +
'opacity' + ': 0.9;' +
'transition' + ': ease 0.5s;' +
'}'
});
});
}
@ -470,24 +485,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
}
this.showMessage = function(text) {
var HIDE_TIME = 2000;
if (!Msg) {
DOM.load.style({
id : 'msg-css',
inner : '#js-view .msg {' +
'z-index' + ': 1;' +
'background-color' + ': #7285B7;' +
'color' + ': #D1F1A9;' +
'position' + ': fixed;' +
'left' + ': 40%;' +
'top' + ': 25px;' +
'padding' + ': 5px;' +
'opacity' + ': 0.9;' +
'transition' + ': ease 0.5s;' +
'}'
});
}
var msg, HIDE_TIME = 2000;
/*
* Msg should be created and removed
@ -496,15 +494,16 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch, Zip, MenuI
* is called - bug occures: empty box
* with no text inside.
*/
Msg = DOM.load({
msg = DOM.load({
name : 'div',
className : 'msg',
parent : Element,
inner : text
inner : text,
func : alert
});
setTimeout(function() {
DOM.remove(Msg, Element);
DOM.remove(msg, Element);
}, HIDE_TIME);
};