Skip to content

Commit f8062d0

Browse files
committed
Fixed:Item editor page: images sorting.
1 parent 6e8a8b3 commit f8062d0

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

src/app/items/editor/item-editor-page.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ images:
7878
<div class="image" style="background-image:url('{{this.url}}')"></div>
7979
</div>
8080
{{/each}}
81-
<a href="" data-toggle="modal" data-target="#modal-media">
81+
<a href="#" class="add-image" data-toggle="modal" data-target="#modal-media">
8282
<div class="image-container new">
8383
<div class="image" >
8484
<i class="fa fa-plus"></i>

src/app/items/editor/item-editor.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ $(function(){
22

33
// set sortable options
44
$('.images-container').sortable({
5-
animation: 150, // ms, animation speed moving items when sorting, `0` — without animation
6-
handle: ".control-btn.move", // Drag handle selector within list items
7-
draggable: ".image-container" // Specifies which items inside the element should be sortable
5+
animation: 150,
6+
handle: ".control-btn.move",
7+
draggable: ".image-container",
8+
onMove: function (evt) {
9+
var $relatedElem = $(evt.related);
10+
11+
if ($relatedElem.hasClass('add-image')) {
12+
return false;
13+
}
14+
}
815
});
916

1017

0 commit comments

Comments
 (0)