diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php
index 6838234..c7b98fd 100755
--- a/frontend/assets/AppAsset.php
+++ b/frontend/assets/AppAsset.php
@@ -22,6 +22,7 @@ class AppAsset extends AssetBundle
'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin',
];
public $js = [
+ 'http://code.jquery.com/jquery-2.1.4.min.js',
'/js/script.js',
//'http://maps.google.com/maps/api/js?sensor=false',
'/js/markerclusterer.js',
@@ -33,11 +34,10 @@ class AppAsset extends AssetBundle
'/js/autoresize.jquery.js',
'/js/jquery.MultiFile.js',
'/js/myGallery_min.js',
-// '/js/forms.js',
'js/fieldWidget.js'
];
public $depends = [
- 'yii\web\YiiAsset',
+// 'yii\web\YiiAsset',
'backend\assets\FileUploadAsset',
];
public $jsOptions = array(
diff --git a/frontend/views/site/forms-modal-fav.php b/frontend/views/site/forms-modal-fav.php
index 0860559..0322032 100644
--- a/frontend/views/site/forms-modal-fav.php
+++ b/frontend/views/site/forms-modal-fav.php
@@ -1,13 +1,16 @@
+
\ No newline at end of file
diff --git a/frontend/web/js/forms.js b/frontend/web/js/forms.js
index f2ee7d1..6bc3e01 100755
--- a/frontend/web/js/forms.js
+++ b/frontend/web/js/forms.js
@@ -1,79 +1,54 @@
$(document).ready(function(){
- //if($('a.contactsLinkModal, .blog-buttons-add-favorite, .performance-vacancy-add-favorite a, .get-list, .blog-buttons-offer, .get-project, .main-menu-icons-home, .main-menu-icons-copy').length>0) {
- //
- // $('.forms-modal-hide').remove();
- // $("#overlay").remove();
- // $("body").append('');
- // $("body").append('');
- //
- // $.post("site/forms-modal", function (data) {
- //
- // $(".forms-modal-hide").append(data);
- //
- // }).complete(function() {
- // $('body').on('click','.closed-form, #overlay', function(){
- // $('#modal_form_favorite, #modal_form_offer, #modal_form_question')
- // .animate({opacity: 0, top: '30%'}, 200,
- // function(){
- // $(this).css('display', 'none');
- // $('#overlay').fadeOut(400);
- // $('.forms-modal-hide').empty();
- // }
- // );
- // });
- // });
- //}
-
-
function addRemoveBlocks(){
$('#overlay, .forms-modal-hide').remove();
$('body').append('').append('');
}
- addToFavorites();
- addToOffer();
-
function addToFavorites(){
- $('.blog-buttons-add-favorite, .performance-vacancy-add-favorite a, .get-list/*, .main-menu-icons-copy*/').click(function(e){
- var newMarg = $(window).scrollTop();
- e.preventDefault()
- $('#overlay').fadeIn(400,
- function(){
- $('#modal_form_favorite')
- .css({display:'block', marginTop:-230+newMarg})
- .animate({opacity: 1, top: '50%'}, 200);
- });
+ $.post("/site/forms-modal-fav", function (data) {
+ $('.forms-modal-hide').append(data)
})
+ .fail(function(){
+ $('#overlay, .forms-modal-hide').remove();
+ alert(txtErrorModal)
+ })
+ .done(function() {
+ var newMarg = $(window).scrollTop();
+ $('#overlay').fadeIn(400,
+ function(){
+ $('.forms-modal-hide>div')
+ .css({display:'block', marginTop:-230+newMarg})
+ .animate({opacity: 1, top: '50%'}, 200);
+ });
+ })
}
function addToOffer(){
- $('.blog-buttons-offer, .get-project/*,.main-menu-icons-home*/').click(function(e){
- var newMarg = $(window).scrollTop();
- e.preventDefault()
- $('#overlay').fadeIn(400,
- function(){
- $('#modal_form_offer')
- .css({display:'block', marginTop:-313+newMarg})
- .animate({opacity: 1, top: '50%'}, 200);
- });
+ $.post("/site/forms-modal-offer", function (data) {
+ $('.forms-modal-hide').append(data)
})
+ .fail(function(){
+ $('#overlay, .forms-modal-hide').remove();
+ alert(txtErrorModal)
+ })
+ .done(function() {
+ var newMarg = $(window).scrollTop();
+ $('#overlay').fadeIn(400,
+ function(){
+ $('.forms-modal-hide>div')
+ .css({display:'block', marginTop:-230+newMarg})
+ .animate({opacity: 1, top: '50%'}, 200);
+ });
+ })
}
-
-
-
-
-
-
-
-
function addContacts() {
$.post("/site/forms-modal-contacts", function (data) {
$('.forms-modal-hide').append(data)
})
.fail(function(){
- addRemoveBlocks()
- alert('ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!')
+ $('#overlay, .forms-modal-hide').remove();
+ alert(txtErrorModal)
})
.done(function() {
var newMarg = $(window).scrollTop();
@@ -86,13 +61,27 @@ $(document).ready(function(){
})
}
-
+ //contacts
$('a.contactsLinkModalFirst').click(function(e){
e.preventDefault()
addRemoveBlocks()
- addContacts();
+ addContacts()
+ })
+ //bookmarks
+ $('.get-list, .performance-vacancy-add-favorite a, .blog-buttons-add-favorite').click(function(e){
+ e.preventDefault()
+ addRemoveBlocks()
+ addToFavorites()
+ })
+ //offer
+ $('a.get-project, .blog-buttons-offer').click(function(e){
+ e.preventDefault()
+ addRemoveBlocks()
+ addToOffer()
})
+ var txtErrorModal = 'ВОЗНИКЛА ОШИБКА, ПОПРОБУЙТЕ ЕЩЕ РАЗ ПОЗЖЕ!';
+
clocseModalForms()
function clocseModalForms(){
$('body').on('click','.closed-form, #overlay', function(){
@@ -107,5 +96,4 @@ $(document).ready(function(){
});
}
-
})
\ No newline at end of file
--
libgit2 0.21.4