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( ) { ...@@ -23,6 +23,8 @@ define( [], function( ) {
* When we start dragging: * When we start dragging:
* get our drawer element * 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. * 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 * set our dragging helper clone
* *
* @since 3.0 * @since 3.0
...@@ -32,10 +34,12 @@ define( [], function( ) { ...@@ -32,10 +34,12 @@ define( [], function( ) {
*/ */
startDrag: function( context, ui ) { startDrag: function( context, ui ) {
this.drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' ); 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.drawerEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'visible', 'important' );
this.draggableHelperClone = jQuery( ui.helper ).clone(); this.draggableHelperClone = jQuery( ui.helper ).clone();
}, },
/** /**
...@@ -48,6 +52,7 @@ define( [], function( ) { ...@@ -48,6 +52,7 @@ define( [], function( ) {
*/ */
stopDrag: function( context, ui ) { stopDrag: function( context, ui ) {
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' ); jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
}, },
getCurrentDraggableHelperClone: function() { getCurrentDraggableHelperClone: function() {
......
...@@ -209,8 +209,6 @@ define( ['builder/models/fields/listOptionModel', 'builder/models/fields/listOpt ...@@ -209,8 +209,6 @@ define( ['builder/models/fields/listOptionModel', 'builder/models/fields/listOpt
optionModel.set( 'order', index ); optionModel.set( 'order', index );
var newPos = index; var newPos = index;
console.log( optionModel.get( 'label' ) + ' old pos - ' + oldPos );
data.objModels.push( { data.objModels.push( {
model: optionModel, model: optionModel,
attr: 'order', attr: 'order',
......
...@@ -248,7 +248,10 @@ define( [], function() { ...@@ -248,7 +248,10 @@ define( [], function() {
* @return void * @return void
*/ */
startFieldsSortable: function( ui ) { startFieldsSortable: function( ui ) {
jQuery( ui.item ).css( 'opacity', '0.5' ).show(); // 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( ) { ...@@ -17,6 +17,7 @@ define( [], function( ) {
/** /**
* When the user starts dragging the staging area, we have to: * 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 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. * replace our helper with the stacked "x fields" template.
* *
* @since 3.0 * @since 3.0
...@@ -26,7 +27,10 @@ define( [], function( ) { ...@@ -26,7 +27,10 @@ define( [], function( ) {
*/ */
startDrag: function( context, ui ) { startDrag: function( context, ui ) {
this.drawerEl = nfRadio.channel( 'app' ).request( 'get:drawerEl' ); 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.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 stagedFields = nfRadio.channel( 'fields' ).request( 'get:staging' );
var html = _.template( jQuery( '#nf-tmpl-staged-fields-drag' ).html(), { num: stagedFields.models.length } ); var html = _.template( jQuery( '#nf-tmpl-staged-fields-drag' ).html(), { num: stagedFields.models.length } );
jQuery( ui.helper ).html( html ); jQuery( ui.helper ).html( html );
...@@ -35,7 +39,7 @@ define( [], function( ) { ...@@ -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 * @since 3.0
* @param Object context jQuery UI Draggable * @param Object context jQuery UI Draggable
...@@ -44,6 +48,7 @@ define( [], function( ) { ...@@ -44,6 +48,7 @@ define( [], function( ) {
*/ */
stopDrag: function( context, ui ) { stopDrag: function( context, ui ) {
jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' ); jQuery( this.drawerEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
jQuery( this.mainEl )[0].style.setProperty( 'overflow', 'hidden', 'important' );
} }
}); });
......
...@@ -16,7 +16,7 @@ define( [], function() { ...@@ -16,7 +16,7 @@ define( [], function() {
var that = this; var that = this;
jQuery( this.el ).find( 'div.nf-one-third' ).draggable( { jQuery( this.el ).find( 'div.nf-one-third' ).draggable( {
opacity: 0.9, opacity: 0.9,
tolerance: 'pointer', tolerance: 'intersect',
scroll: false, scroll: false,
connectToSortable: '.nf-field-type-droppable', 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