Fixes bug in sortable script + broken image ref

Conflicts:
	modules/backend/assets/css/october.css
This commit is contained in:
Samuel Georges 2015-07-19 10:06:41 +10:00
parent 6d5386dd31
commit d9307ef4fe
4 changed files with 3407 additions and 15830 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4371,8 +4371,12 @@ this.init()}
Sortable.prototype=Object.create(BaseProto)
Sortable.prototype.constructor=Sortable
Sortable.prototype.init=function(){this.$el.one('dispose-control',this.proxy(this.dispose))
var sortableOptions={onDragStart:this.proxy(this.onDragStart),onDrag:this.proxy(this.onDrag),onDrop:this.proxy(this.onDrop)}
this.$el.jqSortable($.extend(sortableOptions,this.options))}
var
self=this,sortableOverrides={},sortableDefaults={onDragStart:this.proxy(this.onDragStart),onDrag:this.proxy(this.onDrag),onDrop:this.proxy(this.onDrop)}
if(this.options.onDragStart){sortableOverrides.onDragStart=function($item,container,_super,event){self.options.onDragStart($item,container,sortableDefaults.onDragStart,event)}}
if(this.options.onDrag){sortableOverrides.onDrag=function($item,position,_super,event){self.options.onDrag($item,position,sortableDefaults.onDrag,event)}}
if(this.options.onDrop){sortableOverrides.onDrop=function($item,container,_super,event){self.options.onDrop($item,container,sortableDefaults.onDrop,event)}}
this.$el.jqSortable($.extend({},sortableDefaults,this.options,sortableOverrides))}
Sortable.prototype.dispose=function(){this.$el.jqSortable('destroy')
this.$el.off('dispose-control',this.proxy(this.dispose))
this.$el.removeData('oc.sortable')
@ -4380,8 +4384,6 @@ this.$el=null
this.options=null
this.cursorAdjustment=null
BaseProto.dispose.call(this)}
Sortable.prototype.onDrag=function($item,position,_super,event){if(this.cursorAdjustment){$item.css({left:position.left-this.cursorAdjustment.left,top:position.top-this.cursorAdjustment.top})}
else{$item.css(position)}}
Sortable.prototype.onDragStart=function($item,container,_super,event){var offset=$item.offset(),pointer=container.rootGroup.pointer
if(pointer){this.cursorAdjustment={left:pointer.left-offset.left,top:pointer.top-offset.top}}
else{this.cursorAdjustment=null}
@ -4391,6 +4393,8 @@ $item.addClass('dragged')
$('body').addClass('dragging')
if(this.options.useAnimation){$item.data('oc.animated',true)}
if(this.options.usePlaceholderClone){$(container.rootGroup.placeholder).html($item.html())}}
Sortable.prototype.onDrag=function($item,position,_super,event){if(this.cursorAdjustment){$item.css({left:position.left-this.cursorAdjustment.left,top:position.top-this.cursorAdjustment.top})}
else{$item.css(position)}}
Sortable.prototype.onDrop=function($item,container,_super,event){$item.removeClass('dragged').removeAttr('style')
$('body').removeClass('dragging')
if($item.data('oc.animated')){$item.hide().slideDown(200)}}

View File

@ -544,7 +544,7 @@
.field-richeditor {
border: none;
border-left: 1px solid @color-form-field-border!important;
border-left: 1px solid @color-form-field-border !important;
&, .redactor_box, .redactor_toolbar {
.border-radius(0);
@ -553,7 +553,7 @@
.redactor-box textarea {
background: white;
padding: 20px!important;
padding: 20px !important;
color: #333333;
font-size: 14px;
}
@ -561,8 +561,8 @@
.secondary-content-tabs .field-richeditor {
.redactor-box .redactor-toolbar {
margin: 20px 20px 0 20px!important;
.border-radius(3px)!important;
margin: 20px 20px 0 20px !important;
.border-radius(3px) !important;
}
}
}
@ -581,7 +581,7 @@ html.cssanimations {
.loading-indicator-container {
.loading-indicator > span {
.animation(spin 1s linear infinite);
background-image: url(../../../../../modules/system/assets/ui/images/loader-white.svg);
background-image: url('../../../system/assets/ui/images/loader-white.svg');
background-size: 20px 20px;
}
}

View File

@ -28,13 +28,37 @@
Sortable.prototype.init = function() {
this.$el.one('dispose-control', this.proxy(this.dispose))
var sortableOptions = {
onDragStart: this.proxy(this.onDragStart),
onDrag: this.proxy(this.onDrag),
onDrop: this.proxy(this.onDrop)
var
self = this,
sortableOverrides = {},
sortableDefaults = {
onDragStart: this.proxy(this.onDragStart),
onDrag: this.proxy(this.onDrag),
onDrop: this.proxy(this.onDrop)
}
/*
* Override _super object for each option/event
*/
if (this.options.onDragStart) {
sortableOverrides.onDragStart = function ($item, container, _super, event) {
self.options.onDragStart($item, container, sortableDefaults.onDragStart, event)
}
}
this.$el.jqSortable($.extend(sortableOptions, this.options))
if (this.options.onDrag) {
sortableOverrides.onDrag = function ($item, position, _super, event) {
self.options.onDrag($item, position, sortableDefaults.onDrag, event)
}
}
if (this.options.onDrop) {
sortableOverrides.onDrop = function ($item, container, _super, event) {
self.options.onDrop($item, container, sortableDefaults.onDrop, event)
}
}
this.$el.jqSortable($.extend({}, sortableDefaults, this.options, sortableOverrides))
}
Sortable.prototype.dispose = function() {
@ -47,24 +71,6 @@
BaseProto.dispose.call(this)
}
Sortable.prototype.onDrag = function ($item, position, _super, event) {
if (this.cursorAdjustment) {
/*
* Relative cursor position
*/
$item.css({
left: position.left - this.cursorAdjustment.left,
top: position.top - this.cursorAdjustment.top
})
}
else {
/*
* Default behavior
*/
$item.css(position)
}
}
Sortable.prototype.onDragStart = function ($item, container, _super, event) {
/*
* Relative cursor position
@ -109,6 +115,24 @@
}
}
Sortable.prototype.onDrag = function ($item, position, _super, event) {
if (this.cursorAdjustment) {
/*
* Relative cursor position
*/
$item.css({
left: position.left - this.cursorAdjustment.left,
top: position.top - this.cursorAdjustment.top
})
}
else {
/*
* Default behavior
*/
$item.css(position)
}
}
Sortable.prototype.onDrop = function ($item, container, _super, event) {
$item.removeClass('dragged').removeAttr('style')
$('body').removeClass('dragging')