Skip to content

Commit 13a0fa4

Browse files
authored
Mass+: Improve control button toggle consistency (#2133)
2 parents b751008 + 8766ff6 commit 13a0fa4

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Extensions/mass_plus.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//* TITLE Mass+ **//
2-
//* VERSION 0.4.7 **//
2+
//* VERSION 0.4.8 **//
33
//* DESCRIPTION Enhancements for the Mass Editor **//
44
//* DETAILS This extension allows you to select multiple posts by once, by type or month. It also comes with visual enhancements for the mass post editor, such as selected post count and more! **//
55
//* DEVELOPER STUDIOXENIX **//
@@ -117,23 +117,17 @@ XKit.extensions.mass_plus = new Object({
117117
if (m_type === "select-all") {
118118
$("a.brick").removeClass("highlighted");
119119
$("a.brick:lt(100)").addClass("highlighted");
120-
$(".editor_navigation button").removeAttr('disabled');
121120
XKit.extensions.mass_plus.update_count();
122121
return;
123122
}
124123
if (m_type === "deselect-all") {
125124
$("a.brick").removeClass("highlighted");
126-
$(".editor_navigation button").attr('disabled', 'disabled');
127125
XKit.extensions.mass_plus.update_count();
128126
return;
129127
}
130128
if (m_type === "private") {
131129
$("a.brick").removeClass("highlighted");
132-
$(".editor_navigation button").attr('disabled', 'disabled');
133130
$(".private_overlay:lt(100)").parent().addClass("highlighted");
134-
if ($(".highlighted").length > 0) {
135-
$(".editor_navigation button").removeAttr('disabled');
136-
}
137131
XKit.extensions.mass_plus.update_count();
138132
return;
139133
}
@@ -145,7 +139,6 @@ XKit.extensions.mass_plus = new Object({
145139
}
146140
var m_selector = "a.brick." + m_type + ":lt(100)";
147141
$(m_selector).addClass("highlighted");
148-
$(".editor_navigation button").removeAttr('disabled');
149142
XKit.extensions.mass_plus.update_count();
150143
});
151144
},
@@ -233,6 +226,13 @@ XKit.extensions.mass_plus = new Object({
233226
},
234227
update_count: function(from_click) {
235228
var sel_count = $("a.brick.highlighted").length;
229+
230+
if (sel_count) {
231+
$(".editor_navigation button").removeAttr('disabled');
232+
} else {
233+
$(".editor_navigation button").attr('disabled', 'disabled');
234+
}
235+
236236
$("#xkit-mass-count span").html(sel_count);
237237
if (sel_count === 0 || from_click === true) {
238238
return;

0 commit comments

Comments
 (0)