Commit ed9b0c40 authored by Kevin Stover's avatar Kevin Stover

Merge branch '3.0' into 3.0-alpha

parents a8b75e83 c9770521
......@@ -23,6 +23,8 @@ define( [], function( ) {
* When we start dragging:
* get our drawer element
* set its overflow property to visible !important -> forces the type drag element to be on at the top of the z-index.
* get our main element
* est its overflow propery to visible !important -> forces the type drag element to be on top of the z-index.
* set our dragging helper clone
*
* @since 3.0
......@@ -32,7 +34,9 @@ define( [], function( ) {
*/
startDrag: function( context, ui ) {
this.drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
this.mainEl = nfRadio.channel( 'app' ).request( 'get:mainEl' );
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
this.draggableHelperClone = jQuery( ui.helper ).clone();
......@@ -48,6 +52,7 @@ define( [], function( ) {
*/
stopDrag: function( context, ui ) {
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
},
getCurrentDraggableHelperClone: function() {
......
......@@ -209,8 +209,6 @@ define( ['builder/models/fields/listOptionModel', 'builder/models/fields/listOpt
optionModel.set( 'order', index );
var newPos = index;
console.log( optionModel.get( 'label' ) + ' old pos - ' + oldPos );
data.objModels.push( {
model: optionModel,
attr: 'order',
......
......@@ -248,7 +248,10 @@ define( [], function() {
* @return void
*/
startFieldsSortable: function( ui ) {
// If we aren't dragging an item in from types or staging, update our change log.
if( ! jQuery( ui.item ).hasClass( 'nf-field-type-button' ) && ! jQuery( ui.item ).hasClass( 'nf-stage' ) ) {
jQuery( ui.item ).css( 'opacity', '0.5' ).show();
}
},
/**
......
......@@ -17,6 +17,7 @@ define( [], function( ) {
/**
* When the user starts dragging the staging area, we have to:
* set the overflow property of the drawer to visible !important. If we don't, the button goes underneath the main section.
* set the overflow proerty of the main to visible !important. If we don't, the dragged element goes underneath the drawer.
* replace our helper with the stacked "x fields" template.
*
* @since 3.0
......@@ -26,7 +27,10 @@ define( [], function( ) {
*/
startDrag: function( context, ui ) {
this.drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' );
this.mainEl = nfRadio.channel( 'app' ).request( 'get:mainEl' );
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
var stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );
var html = _.template( jQuery( '#nf-tmpl-staged-fields-drag' ).html(), { num: stagedFields.models.length } );
jQuery( ui.helper ).html( html );
......@@ -35,7 +39,7 @@ define( [], function( ) {
},
/**
* When we stop dragging the staging area, we have to set the overflow property of our drawer to hidden !important
* When we stop dragging the staging area, we have to set the overflow property to hidden !important
*
* @since 3.0
* @param Object context jQuery UI Draggable
......@@ -44,6 +48,7 @@ define( [], function( ) {
*/
stopDrag: function( context, ui ) {
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
}
});
......
......@@ -16,7 +16,7 @@ define( [], function() {
var that = this;
jQuery( this.el ).find( 'div.nf-one-third' ).draggable( {
opacity: 0.9,
tolerance: 'pointer',
tolerance: 'intersect',
scroll: false,
connectToSortable: '.nf-field-type-droppable',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment