瀏覽代碼

Prevent multiple errors from displaying at once.

develop
Ben Kurtovic 9 年之前
父節點
當前提交
890ab4c249
共有 2 個文件被更改,包括 7 次插入3 次删除
  1. +4
    -0
      src/tfd.js
  2. +3
    -3
      tfdclerk.js

+ 4
- 0
src/tfd.js 查看文件

@@ -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 查看文件

@@ -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 */

});
}


Loading…
取消
儲存