Bläddra i källkod

Prevent multiple errors from displaying at once.

develop
Ben Kurtovic 8 år sedan
förälder
incheckning
890ab4c249
2 ändrade filer med 7 tillägg och 3 borttagningar
  1. +4
    -0
      src/tfd.js
  2. +3
    -3
      tfdclerk.js

+ 4
- 0
src/tfd.js Visa fil

@@ -51,6 +51,7 @@ TFD.prototype._unblock_submit = function(reason) {

TFD.prototype._error = function(msg, extra) {
var elem = $("<span/>", {
addClass: "tfdclerk-error",
html: "<strong>Error:</strong> " + (extra ? msg + ": " : msg),
style: "color: #A00;"
});
@@ -76,6 +77,9 @@ TFD.prototype._error = function(msg, extra) {
"persists, you can " + contact.prop("outerHTML") + " or " +
file_bug.prop("outerHTML") + "."
}));

if (this.box.find(".tfdclerk-error"))
this.box.find(".tfdclerk-error").remove();
elem.insertAfter(this.box.find("h5"));
this._block_submit("error");
};


+ 3
- 3
tfdclerk.js Visa fil

@@ -50,7 +50,7 @@ var is_tfd_page = function() {
if (is_tfd_page()) {
mw.loader.using(dependencies, function() {

/* Main script starts here */
/* Main script starts here */

@TFDCLERK_INCLUDE:main.js@
@TFDCLERK_INCLUDE:util.js@
@@ -58,9 +58,9 @@ if (is_tfd_page()) {
@TFDCLERK_INCLUDE:tfd_close.js@
@TFDCLERK_INCLUDE:tfd_relist.js@

$(TFDClerk.install);
$(TFDClerk.install);

/* Main script ends here */
/* Main script ends here */

});
}


Laddar…
Avbryt
Spara