Skip to content

Commit e2fcf62

Browse files
committed
Items Editor add sortable, confirm modal and star/ unstar functionality
1 parent f33c2b3 commit e2fcf62

5 files changed

Lines changed: 43 additions & 255 deletions

File tree

bower.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"nprogress": "~0.2.0",
1818
"quill": "~0.20.1",
1919
"responsive-bootstrap-toolkit": "~2.5.0",
20+
"Sortable": "~1.4.2",
2021
"tether": "~1.1.1",
2122
"tinycolor": "~1.2.1",
2223
"Watch.JS": "watch#*"
@@ -50,6 +51,12 @@
5051
"animate.css": {
5152
"main": "animate.css"
5253
},
54+
"Sortable":{
55+
"main": [
56+
"Sortable.js",
57+
"jquery.binding.js"
58+
]
59+
},
5360
"quill": {
5461
"main": [
5562
"dist/quill.js",

src/app/forms/forms-page.hbs

Lines changed: 0 additions & 253 deletions
This file was deleted.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ images:
6767
<i class="fa fa-arrows"></i>
6868
</a><!--
6969
--><a href="" class="control-btn star">
70-
<i class="fa fa-star-o"></i>
70+
<i class="fa"></i>
7171
</a><!--
72-
--><a href="" class="control-btn remove">
72+
--><a href="#" class="control-btn remove" data-toggle="modal" data-target="#confirm-modal">
7373
<i class="fa fa-trash-o"></i>
7474
</a>
7575
</div>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
$(function(){
2+
3+
// set sortable options
4+
$('.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+
filter: ".new", // Selectors that do not lead to dragging (String or Function)
8+
draggable: ".image-container" // Specifies which items inside the element should be sortable
9+
});
10+
11+
$controlsButtons = $('.controls');
12+
13+
$controlsButtonsStar = $controlsButtons.find('.star');
14+
$controlsButtonsRemove = $controlsButtons.find('.remove');
15+
16+
$controlsButtonsStar.on('click',function(e){
17+
e.preventDefault();
18+
19+
$controlsButtonsStar.removeClass('active')
20+
21+
$(this).addClass('active');
22+
})
23+
24+
})

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@
7373

7474
&.star {
7575
color: #FFB300;
76+
77+
i:before{
78+
content: "\f006";
79+
}
80+
81+
&.active {
82+
i:before{
83+
content: "\f005";
84+
}
85+
}
7686
}
7787

7888
&.remove {

0 commit comments

Comments
 (0)