Don't save profile order twice
This commit is contained in:
@@ -159,9 +159,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#profile_ordering li {
|
#profile_ordering li {
|
||||||
cursor: -webkit-grab;
|
|
||||||
cursor: -moz-grab;
|
|
||||||
cursor: grab;
|
|
||||||
border-bottom: 1px solid rgba(255,255,255,0.2);
|
border-bottom: 1px solid rgba(255,255,255,0.2);
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
}
|
}
|
||||||
@@ -183,6 +180,9 @@
|
|||||||
background: url('../../images/handle.png') center;
|
background: url('../../images/handle.png') center;
|
||||||
width: 20px;
|
width: 20px;
|
||||||
float: right;
|
float: right;
|
||||||
|
cursor: -webkit-grab;
|
||||||
|
cursor: -moz-grab;
|
||||||
|
cursor: grab;
|
||||||
}
|
}
|
||||||
|
|
||||||
#profile_ordering .formHint {
|
#profile_ordering .formHint {
|
||||||
|
|||||||
@@ -135,20 +135,28 @@ var QualityBase = new Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Sortable
|
// Sortable
|
||||||
|
var sorted_changed = false;
|
||||||
self.profile_sortable = new Sortables(profile_list, {
|
self.profile_sortable = new Sortables(profile_list, {
|
||||||
'revert': true,
|
'revert': true,
|
||||||
'handle': '',
|
'handle': '.handle',
|
||||||
'opacity': 0.5,
|
'opacity': 0.5,
|
||||||
'onComplete': self.saveProfileOrdering.bind(self)
|
'onSort': function(){
|
||||||
|
sorted_changed = true;
|
||||||
|
},
|
||||||
|
'onComplete': function(){
|
||||||
|
if(sorted_changed){
|
||||||
|
self.saveProfileOrdering();
|
||||||
|
sorted_changed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
saveProfileOrdering: function(){
|
saveProfileOrdering: function(){
|
||||||
var self = this;
|
var self = this,
|
||||||
|
ids = [],
|
||||||
var ids = [];
|
hidden = [];
|
||||||
var hidden = [];
|
|
||||||
|
|
||||||
self.profile_sortable.list.getElements('li').each(function(el, nr){
|
self.profile_sortable.list.getElements('li').each(function(el, nr){
|
||||||
ids.include(el.get('data-id'));
|
ids.include(el.get('data-id'));
|
||||||
|
|||||||
Reference in New Issue
Block a user