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

Commit 6c0130e

Browse files
authored
Merge pull request #1791 from OpenBazaar/severalFixes
Fix various bugs.
2 parents 8d7e831 + 54cbb5f commit 6c0130e

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

js/templates/itemShort.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
<div class="gridItem clearfix custCol-border <% if(ob.hidden){ %>div-fadeExtra<% } %>">
1010

1111
<div class="itemImg row10 color-secondary custCol-secondary overflowHidden js-item" data-id="<%= ob.contract_hash %>">
12-
<div class="itemImg <% if(ob.cloak){ %> nsfw <% } %>" style="background-image: url(imgs/defaultItem.png);">
13-
<object height="230" width="250" type="image/jpg" data="<%= ob.imageURL %>" ></object>
14-
</div>
12+
<div class="itemImg <% if(ob.cloak){ %> nsfw <% } %>" style="background-image: url(<%= ob.imageURL %>), url(imgs/defaultItem.png);"></div>
1513
</div>
1614
<div class="table">
1715
<div>

js/utils/sanitizeModel.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ module.exports = function(modelObject) {
3030
if (typeof obj[key] === 'object') {
3131
return sanitizeModelData(obj[key]);
3232
}
33-
obj[key] = sanitize(obj[key]);
33+
if (typeof obj[key] === 'string') {
34+
obj[key] = sanitize(obj[key]);
35+
}
3436
});
3537
}
3638
sanitizeModelData(modelObject);

js/views/settingsVw.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,12 @@ module.exports = pageVw.extend({
313313
editor.subscribe('blur', self.validateDescription);
314314

315315
self.sortableAddresses && self.sortableAddresses.destroy();
316-
self.sortableAddresses = Sortable.create(self.$('.js-sortableAddresses')[0], {
317-
chosenClass: "addressBoxDragging",
318-
ghostClass: "addressBoxGhost"
319-
});
316+
if(self.$('.js-sortableAddresses').length) {
317+
self.sortableAddresses = Sortable.create(self.$('.js-sortableAddresses')[0], {
318+
chosenClass: "addressBoxDragging",
319+
ghostClass: "addressBoxGhost"
320+
});
321+
}
320322
});
321323
return this;
322324
},

js/views/storeWizardVw.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = baseModal.extend({
1919
'click .js-storeWizardModal': 'blockClicks',
2020
'click .js-storeWizardSave': 'saveWizard',
2121
'click .js-accordionNext': 'validateDescription',
22+
'click .js-closeStoreWizardModal': 'cancelClick',
2223
'blur input': 'validateInput',
2324
'blur textarea': 'validateInput'
2425
},
@@ -104,7 +105,7 @@ module.exports = baseModal.extend({
104105
self.setValues();
105106
self.$el.find('#storeNameInput').focus();
106107
self.socketView.getModerators(self.socketModeratorID);
107-
108+
108109
var editor = new MediumEditor('#aboutInput', {
109110
placeholder: {
110111
text: ''
@@ -159,7 +160,7 @@ module.exports = baseModal.extend({
159160
this.$el.find('.js-storeWizardModeratorList').append(modShort.el);
160161
this.moderatorCount++;
161162
},
162-
163+
163164
blockClicks: function(e) {
164165
if (!$(e.target).hasClass('js-externalLink')){
165166
e.stopPropagation();
@@ -171,6 +172,10 @@ module.exports = baseModal.extend({
171172
$(e.target).closest('.flexRow').addClass('formChecked');
172173
},
173174

175+
cancelClick: function() {
176+
this.close();
177+
},
178+
174179
saveWizard: function() {
175180
var self = this,
176181
profileForm = this.$el.find('#storeWizardForm'),
@@ -206,4 +211,4 @@ module.exports = baseModal.extend({
206211
}, '', modData);
207212
}, '', wizData);
208213
}
209-
});
214+
});

js/views/userListVw.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ module.exports = Backbone.View.extend({
9595
},
9696

9797
onScroll: function(){
98+
if (!this.listWrapper) return; //if no users have been added, do nothing
9899
if (!this.userShortHeight) this.userShortHeight = this.listWrapper[0].firstElementChild.offsetHeight;
99100
if (this.listWrapper.is(":visible")){
100101

0 commit comments

Comments
 (0)