Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit a4fa148

Browse files
committed
Consolidated variables in addModeratorClick and removeModeratorClick.
1 parent 59a3aad commit a4fa148

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

js/views/userPageVw.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,13 +1468,12 @@ module.exports = baseVw.extend({
14681468
},
14691469

14701470
addModeratorClick: function(e){
1471-
var $targ = $(e.target).closest('.js-addmoderator');
1471+
var $targ = $(e.target).closest('.js-addmoderator'),
1472+
self = this,
1473+
modList = {};
14721474

14731475
$targ.addClass('loading');
14741476

1475-
var self = this;
1476-
1477-
var modList = {};
14781477
modList.moderators = this.model.get('user').moderators;
14791478
modList.moderators.push(this.pageID);
14801479

@@ -1496,14 +1495,13 @@ module.exports = baseVw.extend({
14961495
},
14971496

14981497
removeModeratorClick: function(e){
1499-
var $targ = $(e.target).closest('.js-removemoderator');
1498+
var $targ = $(e.target).closest('.js-removemoderator'),
1499+
self = this,
1500+
modList = {};
15001501

15011502
if($targ.hasClass('confirm')){
15021503
$targ.addClass('loading').removeClass('confirm');
15031504

1504-
var self = this;
1505-
1506-
var modList = {};
15071505
modList.moderators = [];
15081506

15091507
__.each(this.model.get('user').moderators, function(mod) {

0 commit comments

Comments
 (0)