Created
May 31, 2016 14:12
-
-
Save Daniel1984/adf65e5481565ab7c4809fe873e05b20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module = require('refactor/module') | |
templateUrl = require('./cardDetailedItemTemplate.html') | |
class Controller | |
### @ngInject ### | |
constructor: ($element, @_$q, @_cardDetailsModal, @_fullScreenLoading) -> | |
@usedInWrapsPopupVisible = false | |
@cardUsedInWraps = @card.usedInWraps?.length | |
previewCard: -> | |
@_cardDetailsModal.open({ @card, @cards, cloneCard: @cloneCard.bind(@) }) | |
toggleUsedInWrapsPopup: -> | |
@usedInWrapsPopupVisible = !@usedInWrapsPopupVisible | |
cloneCard: -> | |
@_fullScreenLoading.show() | |
return @_$q.all([ | |
@card.clone() | |
@onPagerReset() | |
]).then(=> @_fullScreenLoading.hide()) | |
module.component('wmCardDetailedItem', { | |
bindings: { | |
card: '<' | |
cards: '<' | |
highlight: '<' | |
onPagerReset: '&' | |
} | |
controller: Controller | |
templateUrl | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment