From 01836820a29c11d996d28eb21e70c88ed97b2f3f Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 4 Feb 2016 14:59:32 +0200 Subject: [PATCH] add Vitaliy's widgets --- backend/web/js/fieldWidget.js | 23 +++++++++++++---------- common/config/main-local.php | 6 +++--- frontend/web/js/fieldWidget.js | 26 ++++++++++++++------------ 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/backend/web/js/fieldWidget.js b/backend/web/js/fieldWidget.js index b673819..6423bdf 100755 --- a/backend/web/js/fieldWidget.js +++ b/backend/web/js/fieldWidget.js @@ -1,16 +1,19 @@ -$('body').on('click', '.delete-field-item', function(){ +$(document).ready(function(){ + $('body').on('click', '.delete-field-item', function(){ - $(this).parent('.form-group').remove(); + $(this).parent('.form-group').remove(); -}); + }); -$('.add_field').click(function(){ - var block = $('.fields_video_result'); - var sub_block = '
'+ - ''+ - ''+ - '
'; - block.append(sub_block); + $('.add_field').click(function(){ + var block = $('.fields_video_result'); + var sub_block = '
'+ + ''+ + ''+ + '
'; + block.append(sub_block); + + }); }); \ No newline at end of file diff --git a/common/config/main-local.php b/common/config/main-local.php index 45eebcf..f47e800 100755 --- a/common/config/main-local.php +++ b/common/config/main-local.php @@ -3,9 +3,9 @@ return [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', - 'dsn' => 'pgsql:host=localhost;port=5432;dbname=mfp_local', - 'username' => 'postgres', - 'password' => '', + 'dsn' => 'pgsql:host=195.248.225.149;port=5432;dbname=mfp', + 'username' => 'test33', + 'password' => 'E4q2N7i9', 'schemaMap' => [ 'pgsql'=> [ 'class'=>'yii\db\pgsql\Schema', diff --git a/frontend/web/js/fieldWidget.js b/frontend/web/js/fieldWidget.js index b673819..b10e495 100755 --- a/frontend/web/js/fieldWidget.js +++ b/frontend/web/js/fieldWidget.js @@ -1,16 +1,18 @@ -$('body').on('click', '.delete-field-item', function(){ +$(document).ready(function(){ + $('body').on('click', '.delete-field-item', function(){ + console.log('sfddf'); + $(this).parent('.form-group').remove(); - $(this).parent('.form-group').remove(); - -}); + }); -$('.add_field').click(function(){ - var block = $('.fields_video_result'); - var sub_block = '
'+ - ''+ - ''+ - '
'; - block.append(sub_block); + $('.add_field').click(function(){ + var block = $('.fields_video_result'); + var sub_block = '
'+ + ''+ + ''+ + '
'; + block.append(sub_block); -}); \ No newline at end of file + }); +}); -- libgit2 0.21.4