From 261316e5e4817f548b8033ebb860413dccdb82e2 Mon Sep 17 00:00:00 2001 From: bordoni Date: Tue, 18 Jul 2017 14:59:08 -0300 Subject: [PATCH] Fix one more Problem on Field/Module JS --- ui/js/fields.js | 15 +++++++-------- ui/js/module.js | 2 -- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ui/js/fields.js b/ui/js/fields.js index 51d720d..40f926e 100644 --- a/ui/js/fields.js +++ b/ui/js/fields.js @@ -378,8 +378,6 @@ window.fakerpress.fields.range = function( $, _ ){ $template = $( '.fp-template-' + type ).filter( '[data-rel="' + fieldset.$.container.attr( 'id' ) + '"]' ).filter( '[data-callable]' ); template = $template.html(); - console.log( template ); - // Only place if there is a template if ( template && type !== $conf_container.data( 'type' ) ) { $conf_container.data( 'type', type ); @@ -419,12 +417,6 @@ window.fakerpress.fields.range = function( $, _ ){ index = name.length - 1, key = name[ index ]; - if ( 'undefined' === typeof config[ key ] ) { - return; - } - - $field.val( config[ key ] ); - var $field = $( this ), $label = $field.next( window.fakerpress.fieldset.selector.label ), $internal_label = $field.next( window.fakerpress.fieldset.selector.internal_label ), @@ -462,6 +454,13 @@ window.fakerpress.fields.range = function( $, _ ){ if ( 0 !== name.length ){ $field.attr( 'name', window.fakerpress.fieldName( name ) ); } + + + if ( 'undefined' === typeof config || 'undefined' === typeof config[ key ] ) { + return; + } + + $field.val( config[ key ] ); } ); }, diff --git a/ui/js/module.js b/ui/js/module.js index 1a6f1b9..98a078d 100644 --- a/ui/js/module.js +++ b/ui/js/module.js @@ -17,8 +17,6 @@ if ( 'undefined' === typeof window.fakerpress ){ attrClass = 'notice is-dismissible ' + attrClass; } - console.log( data, html ); - var noticeContent = _.template( html )( data ), templateVars = { 'attrClass': attrClass,