Browse Source
Merge pull request #560 from ryandeba/asset-manage-delete-bug Fixes #549
fix bug with deleting from asset manager
pull/592/head
Artur Arseniev
9 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
src/asset_manager/view/AssetImageView.js
-
test/specs/asset_manager/view/AssetImageView.js
|
|
|
@ -1,9 +1,9 @@ |
|
|
|
module.exports = require('./AssetView').extend({ |
|
|
|
|
|
|
|
events: { |
|
|
|
'click [data-toggle=asset-remove]': 'onRemove', |
|
|
|
click: 'onClick', |
|
|
|
dblclick: 'onDblClick', |
|
|
|
'click [data-toggle=asset-remove]': 'onRemove', |
|
|
|
}, |
|
|
|
|
|
|
|
getPreview() { |
|
|
|
@ -79,7 +79,7 @@ module.exports = require('./AssetView').extend({ |
|
|
|
* @private |
|
|
|
* */ |
|
|
|
onRemove(e) { |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopImmediatePropagation(); |
|
|
|
this.model.collection.remove(this.model); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
@ -66,7 +66,7 @@ module.exports = { |
|
|
|
it('Could be removed', function() { |
|
|
|
var spy = sinon.spy(); |
|
|
|
obj.model.on("remove", spy); |
|
|
|
obj.onRemove({stopPropagation() {}}); |
|
|
|
obj.onRemove({stopImmediatePropagation() {}}); |
|
|
|
expect(spy.called).toEqual(true); |
|
|
|
}); |
|
|
|
|
|
|
|
|