@@ -28,6 +28,17 @@ angular.module("umbraco")
28
28
left : 90
29
29
} ,
30
30
31
+ sort : function ( event , ui ) {
32
+ /* prevent vertical scroll out of the screen */
33
+ var max = $ ( ".usky-grid" ) . width ( ) - 150 ;
34
+ if ( parseInt ( ui . helper . css ( 'left' ) ) > max ) {
35
+ ui . helper . css ( { 'left' : max + "px" } )
36
+ }
37
+ if ( parseInt ( ui . helper . css ( 'left' ) ) < 20 ) {
38
+ ui . helper . css ( { 'left' : 20 } )
39
+ }
40
+ } ,
41
+
31
42
start : function ( e , ui ) {
32
43
ui . item . find ( '.mceNoEditor' ) . each ( function ( ) {
33
44
tinyMCE . execCommand ( 'mceRemoveEditor' , false , $ ( this ) . attr ( 'id' ) ) ;
@@ -46,7 +57,6 @@ angular.module("umbraco")
46
57
var cancelMove = false ;
47
58
48
59
$scope . sortableOptionsCell = {
49
-
50
60
distance : 10 ,
51
61
cursor : "move" ,
52
62
placeholder : "ui-sortable-placeholder" ,
@@ -61,6 +71,18 @@ angular.module("umbraco")
61
71
left : 90
62
72
} ,
63
73
74
+ sort : function ( event , ui ) {
75
+ /* prevent vertical scroll out of the screen */
76
+ var position = parseInt ( ui . item . parent ( ) . offset ( ) . left ) + parseInt ( ui . helper . css ( 'left' ) ) - parseInt ( $ ( ".usky-grid" ) . offset ( ) . left ) ;
77
+ var max = $ ( ".usky-grid" ) . width ( ) - 220 ;
78
+ if ( position > max ) {
79
+ ui . helper . css ( { 'left' : max - parseInt ( ui . item . parent ( ) . offset ( ) . left ) + parseInt ( $ ( ".usky-grid" ) . offset ( ) . left ) + "px" } )
80
+ }
81
+ if ( position < 0 ) {
82
+ ui . helper . css ( { 'left' : 0 - parseInt ( ui . item . parent ( ) . offset ( ) . left ) + parseInt ( $ ( ".usky-grid" ) . offset ( ) . left ) + "px" } )
83
+ }
84
+ } ,
85
+
64
86
over : function ( event , ui ) {
65
87
allowedEditors = $ ( event . target ) . scope ( ) . area . allowed ;
66
88
@@ -527,7 +549,6 @@ angular.module("umbraco")
527
549
} ;
528
550
529
551
530
-
531
552
// *********************************************
532
553
// Init control
533
554
// *********************************************
0 commit comments