[fix] sortable for firefox, fixes frappe/erpnext#7813
This commit is contained in:
parent
e9f2aadd38
commit
6d6a6b6fbb
7 changed files with 40 additions and 22 deletions
|
|
@ -695,7 +695,7 @@ fieldset[disabled] .form-control {
|
|||
padding-left: 20px;
|
||||
}
|
||||
.search-dialog .results-area a {
|
||||
color: #5E64FF;
|
||||
color: #5E64FF;
|
||||
}
|
||||
.search-dialog .results-area .single-link a {
|
||||
color: #36414c;
|
||||
|
|
@ -712,7 +712,7 @@ fieldset[disabled] .form-control {
|
|||
border-bottom: 1px solid #d1d8dd;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.search-dialog .full-list .result .result-subtype{
|
||||
.search-dialog .full-list .result .result-subtype {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,16 +20,21 @@
|
|||
}
|
||||
.column-picker-dialog .column-list .column-list-item {
|
||||
padding: 10px;
|
||||
cursor: move;
|
||||
border-bottom: 1px solid #d1d8dd;
|
||||
}
|
||||
.column-picker-dialog .column-list .column-list-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.column-picker-dialog .column-list .drag-handle {
|
||||
.column-picker-dialog .column-list .sortable-handle {
|
||||
cursor: move;
|
||||
}
|
||||
.column-picker-dialog .column-list .sortable-chosen {
|
||||
background-color: #fffce7;
|
||||
}
|
||||
.column-picker-dialog .column-list .fa-sort {
|
||||
margin: 0px 7px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-top: 9px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
.column-picker-dialog .column-list .form-control {
|
||||
display: inline-block;
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ frappe.ui.form.Grid = Class.extend({
|
|||
|
||||
new Sortable($rows.get(0), {
|
||||
group: {name: 'row'},
|
||||
handle: ".sortable-handle",
|
||||
handle: '.sortable-handle',
|
||||
draggable: '.grid-row',
|
||||
filter: 'li, a',
|
||||
onUpdate: function(event, ui) {
|
||||
|
|
@ -628,7 +628,7 @@ frappe.ui.form.GridRow = Class.extend({
|
|||
var me = this;
|
||||
|
||||
this.wrapper = $('<div class="grid-row"></div>').appendTo(this.parent).data("grid_row", this);
|
||||
this.row = $('<div class="data-row row sortable-handle"></div>').appendTo(this.wrapper)
|
||||
this.row = $('<div class="data-row row"></div>').appendTo(this.wrapper)
|
||||
.on("click", function(e) {
|
||||
if($(e.target).hasClass('grid-row-check') || $(e.target).hasClass('row-index') || $(e.target).parent().hasClass('row-index')) {
|
||||
return;
|
||||
|
|
@ -750,7 +750,7 @@ frappe.ui.form.GridRow = Class.extend({
|
|||
// index (1, 2, 3 etc)
|
||||
if(!this.row_index) {
|
||||
var txt = (this.doc ? this.doc.idx : " ");
|
||||
this.row_index = $('<div class="row-index col col-xs-1">' +
|
||||
this.row_index = $('<div class="row-index sortable-handle col col-xs-1">' +
|
||||
this.row_check_html +
|
||||
' <span>' + txt + '</span></div>')
|
||||
.appendTo(this.row)
|
||||
|
|
@ -787,7 +787,7 @@ frappe.ui.form.GridRow = Class.extend({
|
|||
if(!this.open_form_button) {
|
||||
this.open_form_button = $('<a class="close btn-open-row">\
|
||||
<span class="octicon octicon-triangle-down"></span></a>')
|
||||
.appendTo($('<div class="col col-xs-1"></div>').appendTo(this.row))
|
||||
.appendTo($('<div class="col col-xs-1 sortable-handle"></div>').appendTo(this.row))
|
||||
.on('click', function() { me.toggle_view(); return false; });
|
||||
|
||||
if(this.is_too_small()) {
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@ frappe.avatar = function(user, css_class, title) {
|
|||
|
||||
frappe.get_palette = function(txt) {
|
||||
return '#fafbfc';
|
||||
//return '#8D99A6';
|
||||
if(txt==='Administrator') return '#36414C';
|
||||
// get color palette selection from md5 hash
|
||||
var idx = cint((parseInt(md5(txt).substr(4,2), 16) + 1) / 5.33);
|
||||
if(idx > 47) idx = 47;
|
||||
return frappe.palette[idx][0]
|
||||
// //return '#8D99A6';
|
||||
// if(txt==='Administrator') return '#36414C';
|
||||
// // get color palette selection from md5 hash
|
||||
// var idx = cint((parseInt(md5(txt).substr(4,2), 16) + 1) / 5.33);
|
||||
// if(idx > 47) idx = 47;
|
||||
// return frappe.palette[idx][0]
|
||||
}
|
||||
|
||||
frappe.get_abbr = function(txt, max_length) {
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ frappe.ui.toolbar.clear_cache = function() {
|
|||
|
||||
frappe.ui.toolbar.download_backup = function() {
|
||||
msgprint(__("Your download is being built, this may take a few moments..."));
|
||||
return $c('frappe.utils.backups.get_backup',{},function(r,rt) {});
|
||||
$c('frappe.utils.backups.get_backup',{},function(r,rt) {});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -847,6 +847,11 @@ frappe.ui.ColumnPicker = Class.extend({
|
|||
});
|
||||
|
||||
new Sortable(this.column_list.get(0), {
|
||||
//handle: '.sortable-handle',
|
||||
filter: 'input',
|
||||
draggable: '.column-list-item',
|
||||
chosenClass: 'sortable-chosen',
|
||||
dragClass: 'sortable-chosen',
|
||||
onUpdate: function(event) {
|
||||
me.columns = [];
|
||||
$.each($(me.dialog.body).find('.column-list .column-list-item'),
|
||||
|
|
@ -868,7 +873,8 @@ frappe.ui.ColumnPicker = Class.extend({
|
|||
var me = this;
|
||||
|
||||
var w = $('<div class="column-list-item"><div class="row">\
|
||||
<div class="col-xs-1"><i class="fa fa-sort text-muted drag-handle" style="margin-top: 9px;"></i></div>\
|
||||
<div class="col-xs-1">\
|
||||
<i class="fa fa-sort text-muted"></i></div>\
|
||||
<div class="col-xs-10"></div>\
|
||||
<div class="col-xs-1"><a class="close">×</a></div>\
|
||||
</div></div>')
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
.column-list-item {
|
||||
padding: 10px;
|
||||
cursor: move;
|
||||
border-bottom: 1px solid @border-color;
|
||||
}
|
||||
|
||||
|
|
@ -36,10 +35,18 @@
|
|||
border-bottom: none;
|
||||
}
|
||||
|
||||
.drag-handle {
|
||||
.sortable-handle {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.sortable-chosen {
|
||||
background-color: @light-yellow;
|
||||
}
|
||||
|
||||
.fa-sort {
|
||||
margin: 0px 7px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
margin-top: 9px;
|
||||
margin-right: -15px;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue