Browse Source

Une fonction restorecrayon() pour mutualiser le code

g0uz-patch-1
Cerdic 2 years ago
parent
commit
caf91eaba6
  1. 28
      js/crayons.js

28
js/crayons.js

@ -225,6 +225,19 @@ $.fn.hidecrayon = function() {
return this;
};
$.fn.restorecrayon = function(showButtons) {
this
.removeClass('crayon-loading')
.find("em.crayon-searching")
.remove();
if (showButtons) {
this
.find(".crayon-boutons,.resizehandle")
.show()
}
return this;
}
// active un crayon qui vient d'etre charge
$.fn.activatecrayon = function(percent) {
var focus = false;
@ -271,10 +284,7 @@ $.fn.activatecrayon = function(percent) {
d = {'$erreur': 'erreur de communication :' + ' ' + e.message, '$html':''};
}
}
me
.removeClass('crayon-loading')
.find("em.crayon-searching")
.remove();
me.restorecrayon(false);
//Remise a zero des warnings invalides (unwrap)
crayon
@ -319,14 +329,8 @@ $.fn.activatecrayon = function(percent) {
}
if (d.$erreur > '' || d.$invalides) {
crayon
.find(".crayon-boutons,.resizehandle")
.show()
.end()
.removeClass('crayon-loading')
.find('.crayon-searching')
.remove();
return false;
crayon.restorecrayon(true);
return false;
}
// Desactive celui pour qui on vient de recevoir les nouvelles donnees
$(me)

Loading…
Cancel
Save