Last active
August 29, 2015 13:56
-
-
Save lxcodes/9233314 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
... | |
App.ImagesController = Ember.ArrayController.extend({ | |
imageCount: Ember.computed.alias('length'), | |
actions: { | |
removeSelectedImages: function(){ | |
console.log('called'); | |
} | |
} | |
}); | |
... | |
App.ImageRowView = Ember.View.extend({ | |
classNameBindings: ['isSelected:selected'], | |
click: function() { | |
this.toggleProperty('isSelected'); | |
} | |
}); | |
... | |
App.Image = DS.Model.extend({ | |
filename: DS.attr('string'), | |
url: DS.attr('string'), | |
imported: DS.attr('boolean') | |
}); |
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
<script type='text/x-handlebars' data-template-name='images'> | |
<div class="row"> | |
<div class="col-md-8"> | |
<div class="row"> | |
<div class="col-md-12"> | |
<div class="btn-group"> | |
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">Actions <span class="caret"></span></button> | |
<ul class="dropdown-menu"> | |
<li><a href="#">Merge</a></li> | |
<li><a {{action 'removeSelectedImages' 'remove-image-modal' this}}>Remove</a></li> | |
</ul> | |
</div> | |
Total Images: {{imageCount}} | |
</div> | |
</div> | |
<div class="row image-review"> | |
<div class="col-md-12"> | |
{{#each}} | |
{{#view 'App.ImageRowView' tag='div' classNames='image-row'}} | |
<div class="row"> | |
<div class="col-md-3"> | |
<img {{bind-attr src='url'}} class='img-responsive' /> | |
</div> | |
<div class="col-md-7"> | |
<p><strong>{{#link-to 'image-review' this}}{{filename}} <span class="fa fa-arrow-right">{{/link-to}}</strong></span></p> | |
</div> | |
<div class="col-md-2"></div> | |
</div> | |
{{/view}} | |
{{/each}} | |
</div> | |
</div> | |
</div> | |
<div class="col-md-4"> | |
{{outlet}} | |
</div> | |
</div> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment