|
178 | 178 | ); |
179 | 179 |
|
180 | 180 | $(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') { |
182 | 183 | evt.preventDefault(); |
183 | 184 | if (!evt.ctrlKey && !evt.shiftKey) { |
184 | 185 | if ($('.l-sort__create-btn')[0]) { |
|
382 | 383 | $('.shortcuts').toggle(); |
383 | 384 | }); |
384 | 385 |
|
| 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 | + |
385 | 401 | $('.l-profile__notifications').click(function(){ |
386 | 402 | 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'}); |
391 | 407 |
|
392 | 408 | } else { |
393 | | - $('.notification-container').hide(); |
394 | | - $('.l-profile__notifications').removeClass('active'); |
| 409 | + $('.notification-container').hide(); |
| 410 | + $('.l-profile__notifications').removeClass('active'); |
395 | 411 | } |
396 | 412 | }); |
397 | 413 |
|
|
432 | 448 | }); |
433 | 449 | } |
434 | 450 |
|
435 | | - $(document).click(function(evt){ |
436 | | - //close notification popup |
437 | | - $('.notification-container').hide(); |
438 | | - $('.l-profile__notifications').removeClass('active'); |
439 | | - }); |
| 451 | + |
| 452 | + |
440 | 453 | }); |
441 | 454 | </script> |
442 | 455 |
|
|
0 commit comments