From 5a89cabd78d6b92fc4326ef6139628e612644ea7 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 4 Feb 2016 14:55:05 +0200 Subject: [PATCH] add Vitaliy's widgets --- backend/assets/AppAsset.php | 3 ++- common/widgets/views/education_field.php | 4 +++- frontend/assets/AppAsset.php | 1 + frontend/web/js/fieldWidget.js | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 frontend/web/js/fieldWidget.js diff --git a/backend/assets/AppAsset.php b/backend/assets/AppAsset.php index 1cea55a..8d00af1 100755 --- a/backend/assets/AppAsset.php +++ b/backend/assets/AppAsset.php @@ -23,7 +23,8 @@ class AppAsset extends AssetBundle 'css/flags32.css' ]; public $js = [ - 'js/option.js' + 'js/option.js', + 'js/fieldWidget.js' ]; public $depends = [ 'yii\web\JqueryAsset', diff --git a/common/widgets/views/education_field.php b/common/widgets/views/education_field.php index 6c501ef..446b16a 100755 --- a/common/widgets/views/education_field.php +++ b/common/widgets/views/education_field.php @@ -9,7 +9,9 @@ use yii\helpers\Html;

Добавить поле

- diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index 6d88d39..3ea6485 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -35,6 +35,7 @@ class AppAsset extends AssetBundle '/js/forms.js', '/js/jquery.MultiFile.js', '/js/myGallery_min.js', + 'js/fieldWidget.js' ]; public $depends = [ 'yii\web\YiiAsset', diff --git a/frontend/web/js/fieldWidget.js b/frontend/web/js/fieldWidget.js new file mode 100755 index 0000000..b673819 --- /dev/null +++ b/frontend/web/js/fieldWidget.js @@ -0,0 +1,16 @@ +$('body').on('click', '.delete-field-item', function(){ + + $(this).parent('.form-group').remove(); + +}); + + +$('.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