提交 aae1dc31 编写于 作者: J Jesse Glick

[FIXED JENKINS-18119] More compatible fix: make ts_refresh work again.

上级 2cbaf869
......@@ -88,6 +88,9 @@ Upcoming changes</a>
<li class=bug>
Since 1.477 GET on <code>/view/…/config.xml</code> included a spurious wrapper element.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17302">issue 17302</a>)
<li class=bug>
Revisited fix to be compatible for plugins.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18119">issue 18119</a>)
<li class=rfe>
Clearer display of log messages: chronological order, and coloration of repeated vs. fresh metadata (date, log level, log source).
<li class=bug>
......
......@@ -44,7 +44,7 @@ import org.kohsuke.stapler.bind.JavaScriptMethod;
* (since it may be canceled if the user simply browses to another page while it is running).
* <ol>
* <li>Write a {@code <script>} section defining {@code function display(data)}.
* (Call {@code var t = document.getElementById('someid'); if (t.sortable != null) t.sortable.refresh()} if using a {@code sortable} table.)
* (Call {@code ts_refresh($('someid'))} if using a {@code sortable} table.)
* <li>Use {@code <l:progressiveRendering handler="${it.something()}" callback="display"/>} from your
* Jelly page to display a progress bar and initialize JavaScript infrastructure.
* (The callback attribute can take arbitrary JavaScript expression to be evaluated in the browser
......
......@@ -93,9 +93,7 @@ THE SOFTWARE.
}
r.appendChild(d);
if (p.sortable != null) {
p.sortable.refresh();
}
ts_refresh(p);
}
}
</script>
......
......@@ -364,6 +364,10 @@ function ts_makeSortable(table) { // backward compatibility
return new Sortable.Sortable(table);
}
function ts_refresh(table) { // backward compatibility
return table.sortable.refresh();
/** Calls table.sortable.refresh() in case the sortable has been initialized; otherwise does nothing. */
function ts_refresh(table) {
var s = table.sortable;
if (s != null) {
s.refresh();
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册