File tree Expand file tree Collapse file tree
profile/templates/partials Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ module.exports = function() {
5757 tooltipSpan = null ;
5858 }
5959
60- var handler = hoverIntent ( onOver , onOut , 'a' ) ;
60+ var handler = hoverIntent ( onOver , onOut ) ;
6161 document . addEventListener ( 'mouseover' , function ( event ) {
6262 if ( ! event . target . closest ( 'a' ) ) return ;
6363 handler . call ( this , event ) ;
Original file line number Diff line number Diff line change @@ -8,10 +8,25 @@ function onSearchClick(event) {
88 var searchToggle = event . target . closest ( '.sitetoolbar__search-toggle' ) ;
99
1010 if ( searchToggle ) {
11- var sitetoolbar = document . querySelector ( '.sitetoolbar' ) ;
12- sitetoolbar . classList . toggle ( 'sitetoolbar_search_open' ) ;
13- if ( sitetoolbar . classList . contains ( 'sitetoolbar_search_open' ) ) {
14- sitetoolbar . querySelector ( '.sitetoolbar__search-query input' ) . focus ( ) ;
11+ toggle ( ) ;
12+ }
13+ }
14+
15+ function toggle ( ) {
16+ var sitetoolbar = document . querySelector ( '.sitetoolbar' ) ;
17+ sitetoolbar . classList . toggle ( 'sitetoolbar_search_open' ) ;
18+
19+ var input = sitetoolbar . querySelector ( '.sitetoolbar__search-query input' ) ;
20+ if ( sitetoolbar . classList . contains ( 'sitetoolbar_search_open' ) ) {
21+ input . focus ( ) ;
22+
23+ if ( ! input . onkeydown ) {
24+ input . onkeydown = function ( e ) {
25+ if ( e . keyCode == 27 ) {
26+ this . value = "" ;
27+ toggle ( ) ;
28+ }
29+ } ;
1530 }
1631 }
1732}
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ var handler = hoverIntent(function() {
99 $('.codebox').addEventListener('mouseover', handler);
1010 $('.codebox').addEventListener('mouseout', handler);
1111
12+ TODO: refactor me.
13+
1214 * @param handlerIn
1315 * @param handlerOut
1416 * @returns {Function }
Original file line number Diff line number Diff line change 6767 + e('li' ).usermenu-item
6868 + e('a' ).secondary-link.__usermenu-link ( href ="#profile" ) Профиль
6969 + e('li' ).usermenu-item
70- + e('a' ).secondary-link.__usermenu-link ( href ="#settings" ) Настройки аккаунта
70+ + e('a' ).secondary-link.__usermenu-link ( href ="#settings" ) Аккаунт
7171 + e('li' ).usermenu-item
7272 + e('a' ).secondary-link.__usermenu-link ( href ="#orders" ) Заказы
7373 + e('li' ).usermenu-item
Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ include /bem
1212 + e('profile-field' )( field-name ="country" field-title ="Страна" field-value ="me.country" )
1313 input.text-input__control ( focus-on ="editing" ng-model ="editingValue" type ="text" name ='input' )
1414
15+ // +e('profile-field')(field-name="country" field-title="Страна" field-value="me.country")
16+ select(ng-model="editingValue" name="input")
17+ - var countries = {Russia: 'Россия', Belorussia: 'Белоруссия'}
18+ for title, key in countries
19+ option(value=key)= title
20+
21+
1522 + e('profile-field' )( field-name ="town" field-title ="Город" field-value ="me.town" )
1623 input.text-input__control ( focus-on ="editing" ng-model ="editingValue" type ="text" name ='input' )
1724
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ var Article = require('tutorial').Article;
77// FIXME: many queries to MongoDB for parents (breadcrumbs) Cache them?
88var searchTypes = {
99 articles : {
10- title : 'Учебник ' ,
10+ title : 'Статьи учебника ' ,
1111 hit2url : function ( hit ) {
1212 return Article . getUrlBySlug ( hit . fields . slug [ 0 ] ) ;
1313 } ,
Original file line number Diff line number Diff line change @@ -38,8 +38,15 @@ block content
3838
3939 if results .length < resultsCountPerType[searchType]
4040 + e.count-note Показываются первые #{results .length } результатов.
41- else
42- + b.search-results Извините, мы ничего не нашли.
41+ else if searchQuery
42+ + b.search-results
43+ | Извините, мы ничего не нашли
44+ = ' '
45+ if searchType== " articles"
46+ | в статьях учебника
47+ if searchType== " tasks"
48+ | в задачах
49+ | .
4350
4451 + b("form" ).search-form._fixed._hidden ( action ="/search/" )
4552 + e.content
Original file line number Diff line number Diff line change 1- // use env.SECRET_DIR/secret.js if exists OR ./secret.example
1+ // use env.SECRET_DIR/secret.js if exists OR ./secret.example
22
33var path = require ( 'path' ) ;
44var fs = require ( 'fs' ) ;
Original file line number Diff line number Diff line change 1111 "filter" : [
1212 " lowercase" ,
1313 " russian_morphology" ,
14- " english_morphology" ,
15- " ru_en_stopwords"
14+ " english_morphology"
1615 ]
1716 }
1817 },
Original file line number Diff line number Diff line change @@ -76,16 +76,15 @@ block append variables
7676 + e('form' ).search-content ( method ="GET" , action ="/search" )
7777 + e.search-query-wrap
7878 + b.text-input.__search-query
79- + e('input' ).control ( type ="text" )
79+ + e('input' ).control ( name = "query" type ="text" )
8080 + e.search-submit-wrap
81- + b('button' ).submit-button.__search-submit
82- | Найти
81+ + b('button' ).submit-button.__search-submit Найти
8382 if user
8483 + e.usermenu
8584 + e('ul' ).usermenu-items
8685 + e('li' ).usermenu-item
8786 + e('a' ).secondary-link.__usermenu-link ( href ="/profile" ) Профиль
8887 + e('li' ).usermenu-item
89- + e('a' ).secondary-link.__usermenu-link ( href ="/profile/account" ) Настройки аккаунта
88+ + e('a' ).secondary-link.__usermenu-link ( href ="/profile/account" ) Аккаунт
9089 + e('li' ).usermenu-item
9190 + e('a' ).secondary-link.__usermenu-link ( href ="#" data-action-user-logout ) Выйти
You can’t perform that action at this time.
0 commit comments