Skip to content

Commit

Permalink
stub: make custom templates above others (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xi-Plus committed Jul 18, 2020
2 parents 6b6b136 + 8353e86 commit 58aa17a
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions modules/twinklestub.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ Twinkle.stub.updateSortOrder = function(e) {
return checkbox;
};

// append any custom tags
if (Twinkle.getPref('customStubList').length) {
container.append({ type: 'header', label: wgULS('自定义模板', '自訂模板') });
var customcheckboxes = [];
$.each(Twinkle.getPref('customStubList'), function(_, item) {
customcheckboxes.push(makeCheckbox(item.value, item.label));
});
container.append({
type: 'checkbox',
name: 'articleTags',
list: customcheckboxes
});
}

// categorical sort order
if (sortorder === 'cat') {
// function to iterate through the tags and create a checkbox for each one
Expand Down Expand Up @@ -154,20 +168,6 @@ Twinkle.stub.updateSortOrder = function(e) {
});
}

// append any custom tags
if (Twinkle.getPref('customStubList').length) {
container.append({ type: 'header', label: wgULS('自定义模板', '自訂模板') });
var customcheckboxes = [];
$.each(Twinkle.getPref('customStubList'), function(_, item) {
customcheckboxes.push(makeCheckbox(item.value, item.label));
});
container.append({
type: 'checkbox',
name: 'articleTags',
list: customcheckboxes
});
}

var $workarea = $(e.target.form).find('div#tagWorkArea');
var rendered = container.render();
$workarea.empty().append(rendered);
Expand Down

0 comments on commit 58aa17a

Please sign in to comment.