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

Commit 095c223

Browse files
committed
Merge pull request #1531 from OpenBazaar/codeCleanup
cleaning up code
2 parents 0921360 + c753b7a commit 095c223

16 files changed

+84
-76
lines changed

js/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function App() {
1818
// TODO: rather than attach the serverConfigs CL
1919
// in main.js, pass in the instance here so the
2020
// dependency is more explicit.
21-
};
21+
}
2222

2323
App.prototype.connectHeartbeatSocket = function() {
2424
var activeServer = this.serverConfigs.getActive();

js/router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ module.exports = Backbone.Router.extend({
5555
history.back = function() {
5656
self.historyAction = 'back';
5757
return originalHistoryBack(arguments);
58-
}
58+
};
5959

6060
var originalHistoryForward = history.forward;
6161
history.forward = function() {
6262
self.historyAction = 'forward';
6363
return originalHistoryForward(arguments);
64-
}
64+
};
6565

6666
this.historySize = -1;
6767
this.historyPosition = -1;

js/start.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ launchOnboarding = function(guidCreating) {
459459
polyglot.t('serverConnectModal.connectingTo', { serverName: activeServer.get('name') })
460460
}
461461
});
462-
})()
462+
})();
463463

464464
pageConnectModal.on('cancel', () => {
465465
removeStartupRetry();
@@ -565,7 +565,7 @@ app.getHeartbeatSocket().on('message', function(e) {
565565
$.getJSON(app.serverConfigs.getActive().getServerBaseUrl() + '/profile')
566566
.done(function(profile, textStatus) {
567567
if (textStatus == 'parsererror') {
568-
alert(window.polyglot.t('errorMessages.serverError'), window.polyglot.t('errorMessages.badJSON'));
568+
alert(window.polyglot.t('errorMessages.serverError') +"\n\n"+ window.polyglot.t('errorMessages.badJSON'));
569569
app.serverConnectModal.failConnection(null, app.serverConfigs.getActive())
570570
.open();
571571
return;

js/utils/jquery.cropit.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,4 +1156,3 @@ return /******/ (function(modules) { // webpackBootstrap
11561156
/***/ }
11571157
/******/ ])
11581158
});
1159-
;

js/utils/localize.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ function localizeShippingRegions(regions) {
2020

2121
module.exports = {
2222
localizeShippingRegions: localizeShippingRegions
23-
}
23+
};

js/utils/messageModal.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ function showModal(errorTitle, errorMessage, titleClass, msgClass, onBtn1, onBtn
1212
if(typeof onBtn1 === "function"){
1313
if(!onBtn1Msg){
1414
throw new Error("button text for button 1 must be provided");
15-
return;
1615
}
1716
$el.find('.js-messageModal-btnBar').removeClass('hide');
1817
$el.find('.js-messageModal-btn1').off().on('click', onBtn1).text(onBtn1Msg).addClass(onBtn1Class);
@@ -21,7 +20,6 @@ function showModal(errorTitle, errorMessage, titleClass, msgClass, onBtn1, onBtn
2120
if(typeof onBtn2 === "function"){
2221
if(!onBtn1Msg){
2322
throw new Error("button text for button 2 must be provided");
24-
return;
2523
}
2624
$el.find('.js-messageModal-btn2').off().on('click', onBtn2).text(onBtn2Msg).addClass(onBtn2Class);
2725
} else {

js/views/buyWizardVw.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ module.exports = baseVw.extend({
531531

532532
if(!data) {
533533
throw new Error('Data must be provided to the showPayAddress function');
534-
return;
535534
}
536535

537536
var totalBTCPrice = 0,

js/views/itemEditVw.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ module.exports = baseVw.extend({
9797

9898
self.$photosModule = self.$('.js-photosModule');
9999

100-
this.sortableImages && this.sortableImages.destroy();
101-
this.sortableImages = Sortable.create(self.$('.js-subImageWrap')[0], {
100+
self.sortableImages && self.sortableImages.destroy();
101+
self.sortableImages = Sortable.create(self.$('.js-subImageWrap')[0], {
102102
onUpdate: function(e) {
103103
var imagesArr = self.model.get('imageHashesToUpload');
104104

js/views/pageNavServersVw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ module.exports = BaseVw.extend({
4040
serverConfig = app.serverConfigs.get($target.data('server-config-id'));
4141

4242
// launch page connect modal
43-
this.pageConnectModal && this.pageConnectModal.remove()
43+
this.pageConnectModal && this.pageConnectModal.remove();
4444
this.pageConnectModal = new PageConnectModal({
4545
className: 'server-connect top0',
4646
initialState: {

js/views/pageNavVw.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,25 +351,26 @@ module.exports = baseVw.extend({
351351
},
352352

353353
aboutModalTabClick: function(e){
354-
var tab = $(e.currentTarget).data('tab');
354+
var tab = $(e.currentTarget).data('tab'),
355+
$aboutSection = $('.modal-about-section');
355356
this.$aboutModal.find('.btn-tab').removeClass('active');
356357
$(e.currentTarget).addClass('active');
357358

358359
switch(tab) {
359360
case "about":
360-
$('.modal-about-section').addClass('hide');
361+
$aboutSection.addClass('hide');
361362
$('.js-modalAboutMain').removeClass('hide');
362363
break;
363364
case "support":
364-
$('.modal-about-section').addClass('hide');
365+
$aboutSection.addClass('hide');
365366
$('.js-modalAboutSupport').removeClass('hide');
366367
break;
367368
case "contributors":
368-
$('.modal-about-section').addClass('hide');
369+
$aboutSection.addClass('hide');
369370
$('.js-modalAboutContributors').removeClass('hide');
370371
break;
371372
case "licensing":
372-
$('.modal-about-section').addClass('hide');
373+
$aboutSection.addClass('hide');
373374
$('.js-modalAboutLicensing').removeClass('hide');
374375
break;
375376
}

0 commit comments

Comments
 (0)