Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-01 14:12:15 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-01 14:23:33 -0500
commit799a74d7a13ff45df85a6dea6e63af6a36193e1c (patch)
tree1f209c402c204a3e984b1473a2fe3cd6970f1490
parentaf7774a272a2b7cc1e34e3082a473a5d71a83355 (diff)
downloadliza-799a74d7a13ff45df85a6dea6e63af6a36193e1c.tar.gz
liza-799a74d7a13ff45df85a6dea6e63af6a36193e1c.tar.bz2
liza-799a74d7a13ff45df85a6dea6e63af6a36193e1c.zip
NaFieldStylerAnimation: Remove trait
These animations are ugly and slow when there are many questions on a step. I've wanted them gone for quite some time, and now we don't have a disagreement among developers. * src/client/ClientDependencyFactory.js (createNaFieldStyler): Remove NaFieldStylerAnimation mixin. * src/ui/styler/NaFieldStylerAnimation.js: Remove trait.
-rw-r--r--src/client/ClientDependencyFactory.js8
-rw-r--r--src/ui/styler/NaFieldStylerAnimation.js103
2 files changed, 3 insertions, 108 deletions
diff --git a/src/client/ClientDependencyFactory.js b/src/client/ClientDependencyFactory.js
index 2f27dc9..a157f94 100644
--- a/src/client/ClientDependencyFactory.js
+++ b/src/client/ClientDependencyFactory.js
@@ -1,7 +1,7 @@
/**
* Factory for Client dependencies
*
- * Copyright (C) 2017 R-T Specialty, LLC.
+ * Copyright (C) 2017, 2018 R-T Specialty, LLC.
*
* This file is part of the Liza Data Collection Framework
*
@@ -91,8 +91,7 @@ var Step = require( '../step/Step' ),
SidebarErrorStyler = require( '../ui/styler/SidebarErrorStyler' ),
ErrorFieldStyler = require( '../ui/styler/ErrorFieldStyler' ),
- NaFieldStyler = require( '../ui/styler/NaFieldStyler' ),
- NaFieldStylerAnimation = require( '../ui/styler/NaFieldStylerAnimation' ),
+ NaFieldStyler = require( '../ui/styler/NaFieldStyler' ),
DelegateEventHandler = require( './event/DelegateEventHandler' ),
@@ -331,8 +330,7 @@ module.exports = Class( 'ClientDependencyFactory',
createNaFieldStyler: function()
{
- return NaFieldStyler
- .use( NaFieldStylerAnimation( jQuery ) )();
+ return NaFieldStyler();
},
createFormErrorBox: FormErrorBox,
diff --git a/src/ui/styler/NaFieldStylerAnimation.js b/src/ui/styler/NaFieldStylerAnimation.js
deleted file mode 100644
index 1e5829b..0000000
--- a/src/ui/styler/NaFieldStylerAnimation.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Animated N/A field styler
- *
- * Copyright (C) 2016 R-T Specialty, LLC.
- *
- * This file is part of liza.
- *
- * liza is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-var Trait = require( 'easejs' ).Trait,
- NaFieldStyler = require( './NaFieldStyler' );
-
-
-/**
- * Sliding animations for field show/hide
- *
- * @todo Use CSS3 once we can drop support for IE<10
- */
-module.exports = Trait.extend( NaFieldStyler,
-{
- /**
- * jQuery instance
- * @type {jQuery}
- */
- 'private _jquery': null,
-
-
- /**
- * Prepare mixin with jQuery instance
- *
- * @param {jQuery} jquery jQuery instance
- */
- __mixin: function( jquery )
- {
- this._jquery = jquery;
- },
-
-
- /**
- * Animate field display
- *
- * When a field becomes applicable, progressively increase its height
- * ("slide down").
- *
- * @param {HTMLElement} element field DOM element
- * @param {Array.<HTMLElement} row parent row elements
- *
- * @return {undefined}
- */
- 'override protected showField': function( element, row )
- {
- var $row = this._jquery( row ),
- $element = this._jquery( element );
-
- $row.stop( true, true );
-
- this.__super( element, row );
-
- // jQuery adds its own styling (e.g. display:none)
- $element.show();
-
- $row
- .hide()
- .slideDown( 500 );
- },
-
-
- /**
- * Animate field hiding
- *
- * When a field becomes non-applicable, progressively decrease its
- * height ("slide up").
- *
- * @param {HTMLElement} element field DOM element
- * @param {Array.<HTMLElement} row parent row elements
- *
- * @return {undefined}
- */
- 'override protected hideField': function( element, row )
- {
- var _self = this,
- all = [ element ].concat( row ),
- $elements = this._jquery( all );
-
- $elements.stop( true, true )
- .slideUp( 500, function()
- {
- _self.hideField['super'].call( _self, element, row );
- } );
- }
-} );