Skip to content

Commit b7461af

Browse files
committed
footer update
1 parent 1c3ac33 commit b7461af

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

web/templates/footer.html

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@
178178
);
179179

180180
$(window).bind('keypress', function(evt) {
181-
if (evt.charCode == 97) {
181+
var tag = evt.target.tagName.toLowerCase();
182+
if (evt.charCode == 97 && tag != 'input' && tag != 'textarea' && tag != 'selectbox') {
182183
evt.preventDefault();
183184
if (!evt.ctrlKey && !evt.shiftKey) {
184185
if ($('.l-sort__create-btn')[0]) {
@@ -382,16 +383,31 @@
382383
$('.shortcuts').toggle();
383384
});
384385

386+
$(document).click(function(evt){
387+
//close notification popup
388+
if(!$(evt.target).hasClass('l-profile__notifications') && $(evt.target).parents('ul.notification-container').length == 0){
389+
$('.notification-container').hide();
390+
$('.l-profile__notifications').removeClass('active');
391+
}
392+
});
393+
394+
395+
// focusing on the first input at form
396+
if(location.href.indexOf('lead=') == -1){
397+
$('#vstobjects .vst-input:not([disabled]), #vstobjects .vst-list:not([disabled])').first().focus();
398+
}
399+
400+
385401
$('.l-profile__notifications').click(function(){
386402
if(!$('.l-profile__notifications').hasClass('active')){
387-
VE.notifications.get_list();
388-
$('.l-profile__notifications').addClass('active');
389-
left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
390-
$('.notification-container').css({left: left+'px'});
403+
VE.notifications.get_list();
404+
$('.l-profile__notifications').addClass('active');
405+
left = $('.l-profile__notifications').offset().left - $('.notification-container').outerWidth() + 28;
406+
$('.notification-container').css({left: left+'px'});
391407

392408
} else {
393-
$('.notification-container').hide();
394-
$('.l-profile__notifications').removeClass('active');
409+
$('.notification-container').hide();
410+
$('.l-profile__notifications').removeClass('active');
395411
}
396412
});
397413

@@ -432,11 +448,8 @@
432448
});
433449
}
434450

435-
$(document).click(function(evt){
436-
//close notification popup
437-
$('.notification-container').hide();
438-
$('.l-profile__notifications').removeClass('active');
439-
});
451+
452+
440453
});
441454
</script>
442455

0 commit comments

Comments
 (0)