mirror of
https://github.com/flarum/core.git
synced 2025-08-16 05:14:20 +02:00
Use the variables that are already instantiated
This commit is contained in:
4
extensions/tags/js/forum/dist/extension.js
vendored
4
extensions/tags/js/forum/dist/extension.js
vendored
@@ -553,13 +553,13 @@ System.register('flarum/tags/components/TagDiscussionModal', ['flarum/components
|
|||||||
|
|
||||||
// If the number of selected primary/secondary tags is at the maximum, then
|
// If the number of selected primary/secondary tags is at the maximum, then
|
||||||
// we'll filter out all other tags of that type.
|
// we'll filter out all other tags of that type.
|
||||||
if (primaryCount >= app.forum.attribute('maxPrimaryTags')) {
|
if (primaryCount >= this.maxPrimary) {
|
||||||
tags = tags.filter(function (tag) {
|
tags = tags.filter(function (tag) {
|
||||||
return !tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
|
return !tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secondaryCount >= app.forum.attribute('maxSecondaryTags')) {
|
if (secondaryCount >= this.maxSecondary) {
|
||||||
tags = tags.filter(function (tag) {
|
tags = tags.filter(function (tag) {
|
||||||
return tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
|
return tag.isPrimary() || _this2.selected.indexOf(tag) !== -1;
|
||||||
});
|
});
|
||||||
|
@@ -116,11 +116,11 @@ export default class TagDiscussionModal extends Modal {
|
|||||||
|
|
||||||
// If the number of selected primary/secondary tags is at the maximum, then
|
// If the number of selected primary/secondary tags is at the maximum, then
|
||||||
// we'll filter out all other tags of that type.
|
// we'll filter out all other tags of that type.
|
||||||
if (primaryCount >= app.forum.attribute('maxPrimaryTags')) {
|
if (primaryCount >= this.maxPrimary) {
|
||||||
tags = tags.filter(tag => !tag.isPrimary() || this.selected.indexOf(tag) !== -1);
|
tags = tags.filter(tag => !tag.isPrimary() || this.selected.indexOf(tag) !== -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secondaryCount >= app.forum.attribute('maxSecondaryTags')) {
|
if (secondaryCount >= this.maxSecondary) {
|
||||||
tags = tags.filter(tag => tag.isPrimary() || this.selected.indexOf(tag) !== -1);
|
tags = tags.filter(tag => tag.isPrimary() || this.selected.indexOf(tag) !== -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user