|
20 | 20 | :host { |
21 | 21 | display: block; |
22 | 22 | } |
23 | | - |
| 23 | + [userlogin] { |
| 24 | + display:none; |
| 25 | + } |
| 26 | + |
24 | 27 | [drawer] { |
25 | 28 | background-color: #fff; |
26 | 29 | box-shadow: 1px 0 1px rgba(0, 0, 0, 0.1); |
|
57 | 60 | background-color:#ffffff; |
58 | 61 | color:#000000; |
59 | 62 | border-radius: 30px; |
60 | | - margin-left:-8px; |
61 | 63 | display:none; |
| 64 | + transition: -webkit-transform ease-in-out 0.3s, margin-left ease-in-out 0.3s; |
| 65 | + transition: transform ease-in-out 0.3s, margin-left ease-in-out 0.3s; |
62 | 66 | } |
63 | | - |
64 | 67 | #siteSearchNarrow::shadow core-icon{ |
65 | 68 | height:15px; |
66 | 69 | width:15px; |
|
87 | 90 | } |
88 | 91 |
|
89 | 92 | #divContainerNarrowSearch { |
90 | | - height:0px; |
91 | | - overflow:hidden; |
92 | | - position:absolute;top:0px;left:0px;background-color:#304ffe;width:100%;font-size:1.3em;padding-left:30px; |
| 93 | + position:absolute;top:0px;left:0px; |
| 94 | + background-color:#304ffe; |
| 95 | + width:100%; |
| 96 | + font-size:1.3em; |
| 97 | + padding-left:10px; |
93 | 98 | padding-top:0px; |
94 | 99 | transition: -webkit-transform ease-in-out 0.3s, height ease-in-out 0.3s; |
95 | 100 | transition: transform ease-in-out 0.3s, height ease-in-out 0.3s; |
96 | 101 | } |
97 | | - |
| 102 | + .divContainerNarrowSearchClosed{ |
| 103 | + height:0px; |
| 104 | + overflow:hidden; |
| 105 | + } |
| 106 | + .divContainerNarrowSearchOpen{ |
| 107 | + height:40px; |
| 108 | + } |
| 109 | + |
98 | 110 | #searchInput{ |
99 | 111 | background-color:#FFFFFF; |
100 | 112 | font-size:.6em; |
|
106 | 118 | width:200px; |
107 | 119 | float:left; |
108 | 120 | } |
| 121 | + |
| 122 | + #searchInputNarrow{ |
| 123 | + background-color:#FFFFFF; |
| 124 | + font-size:.6em; |
| 125 | + padding-top:5px; |
| 126 | + padding-bottom:5px; |
| 127 | + padding-left:5px; |
| 128 | + border-top-left-radius: 30px; |
| 129 | + border-bottom-left-radius: 30px; |
| 130 | + width:200px; |
| 131 | + float:left; |
| 132 | + } |
109 | 133 |
|
110 | 134 | #searchInputCategory { |
111 | 135 | background-color: #FFFFFF; |
|
119 | 143 | #searchInputCategory::shadow div core-item { |
120 | 144 | min-height: 5px !important; |
121 | 145 | } |
| 146 | + #searchInputCategoryNarrow { |
| 147 | + background-color: #FFFFFF; |
| 148 | + color:#cccccc; |
| 149 | + font-size:.6em; |
| 150 | + min-height: 6px; |
| 151 | + margin-left: -6px; |
| 152 | + border-left: solid 1px #Cccccc; |
| 153 | + float:left; |
| 154 | + border-top-right-radius: 30px; |
| 155 | + border-bottom-right-radius: 30px; |
| 156 | + } |
| 157 | + #searchInputCategoryNarrow::shadow div core-item { |
| 158 | + min-height: 5px !important; |
| 159 | +} |
122 | 160 |
|
123 | 161 | .searchInputCategoryItem.core-selected{ |
124 | 162 | min-height: 5px; |
|
152 | 190 | width:335px; |
153 | 191 | } |
154 | 192 |
|
| 193 | + div.divFullSearchOpening{ |
| 194 | + width:335px; |
| 195 | + overflow:hidden; |
| 196 | + } |
155 | 197 | div.divFullSearchOpen{ |
156 | 198 | width:335px; |
157 | 199 | } |
|
297 | 339 |
|
298 | 340 | } |
299 | 341 | } |
300 | | - |
| 342 | + |
| 343 | + #headerUserInfo{ |
| 344 | + margin-left:auto;margin-right:10px; |
| 345 | + } |
301 | 346 | </style> |
302 | 347 |
|
303 | 348 | <core-media-query query="max-width: {{responsiveWidthStep2 }}" queryMatches="{{queryMatchesStep2}}"></core-media-query> |
|
321 | 366 | </div> |
322 | 367 | </div> |
323 | 368 | </template> |
324 | | - <paper-icon-button id="siteSearchNarrow" data-toggle="off" icon="search" on-tap="" ></paper-icon-button> |
| 369 | + <paper-icon-button id="siteSearchNarrow" data-toggle="off" icon="search" on-tap="{{siteSearchNarrowToggle}}" ></paper-icon-button> |
325 | 370 | <template if="{{showHeaderFilter}}"> |
326 | 371 | <paper-icon-button id="menuFilterSearch" icon="filter" on-tap="" label="Filter"></paper-icon-button> |
327 | 372 | </template> |
328 | | - |
| 373 | + <div id="headerUserInfo"> |
329 | 374 | <content select="[userlogin]"></content> |
| 375 | + </div> |
330 | 376 | </core-toolbar> |
331 | 377 |
|
332 | 378 | <trutek-tri-drawer-panel id="drawerPanel" narrow="{{narrow}}" responsiveWidth="{{responsiveWidth}}" responsiveWidthStep1="{{responsiveWidthStep1}}" responsiveWidthStep2="{{responsiveWidthStep2}}"> |
|
337 | 383 |
|
338 | 384 | </div> |
339 | 385 | <div main> |
340 | | - <div id="divContainerNarrowSearch"> |
| 386 | + <div id="divContainerNarrowSearch" class="divContainerNarrowSearchClosed"> |
| 387 | + <div style="float:left;padding-top:5px;"><core-input id="searchInputNarrow" placeholder="{{headerSearchPlaceHolder}}" type="search"></core-input> |
| 388 | + <core-dropdown id="searchInputCategoryNarrow" selected="Clothing" valueattr="label"> |
| 389 | + <core-item label="Clothing" class="searchInputCategoryItem"></core-item> |
| 390 | + <core-item label="Outdoors" class="searchInputCategoryItem"></core-item> |
| 391 | + <core-item label="Sports" class="searchInputCategoryItem"></core-item> |
| 392 | + </core-dropdown> |
| 393 | + </div> |
341 | 394 | </div> |
342 | 395 | <content select="*"></content> |
343 | 396 | </div> |
|
366 | 419 | showHeaderSearch:true, |
367 | 420 | showHeaderFilter:true, |
368 | 421 | headerSearchPlaceHolder:"Search...", |
| 422 | + headerPanelNarrow: {value: false, reflect: true}, |
369 | 423 |
|
370 | 424 | /** |
371 | 425 | * Used to control the header and scrolling behaviour of `core-header-panel` |
|
410 | 464 | }, |
411 | 465 |
|
412 | 466 | toggleSearchPanel: function() { |
413 | | - |
414 | | - if(this.$.siteSearchHeader.dataset.state!="open"){ |
415 | | - this.$.divFullSearch.className="divFullSearchOpen"; |
416 | | - this.$.siteSearchHeader.dataset.state="open"; |
417 | | - this.$.siteSearchHeader.className="siteSearchHeaderSearch"; |
| 467 | + |
| 468 | + if(!this.headerPanelNarrow){ |
| 469 | + if(this.$.siteSearchHeader.dataset.state!="open"){ |
| 470 | + this.$.divFullSearch.className="divFullSearchOpening"; |
| 471 | + this.$.siteSearchHeader.dataset.state="open"; |
| 472 | + this.$.siteSearchHeader.className="siteSearchHeaderSearch"; |
| 473 | + } |
| 474 | + else{ |
| 475 | + this.$.divFullSearch.className="divFullSearchClosed"; |
| 476 | + this.$.siteSearchHeader.dataset.state="closed"; |
| 477 | + this.$.siteSearchHeader.className="siteSearchHeaderSearchArrow"; |
| 478 | + } |
418 | 479 | } |
419 | 480 | else{ |
420 | | - this.$.divFullSearch.className="divFullSearchClosed"; |
421 | | - this.$.siteSearchHeader.dataset.state="closed"; |
422 | | - this.$.siteSearchHeader.className="siteSearchHeaderSearchArrow"; |
| 481 | + if(this.$.siteSearchHeader.dataset.state!="open"){ |
| 482 | + this.$.siteSearchHeader.dataset.state="open"; |
| 483 | + this.$.siteSearchHeader.className="siteSearchHeaderSearch"; |
| 484 | + this.$.divContainerNarrowSearch.className="divContainerNarrowSearchOpen"; |
| 485 | + this.$.siteSearchNarrow.style.display="block"; |
| 486 | + this.$.siteSearchNarrow.style.marginLeft="0px"; |
| 487 | + } |
| 488 | + else{ |
| 489 | + this.$.siteSearchHeader.dataset.state="closed"; |
| 490 | + this.$.siteSearchHeader.className="siteSearchHeaderSearchArrow"; |
| 491 | + this.$.divContainerNarrowSearch.className="divContainerNarrowSearchClosed"; |
| 492 | + this.$.siteSearchNarrow.style.marginLeft="-45px"; |
| 493 | + |
| 494 | + } |
423 | 495 | } |
424 | 496 |
|
425 | 497 | this.fire('change'); |
426 | 498 |
|
427 | 499 | }, |
428 | | - |
| 500 | + |
429 | 501 | queryMatchesStep2Changed: function() { |
430 | | - if (this.queryMatchesStep2) { |
431 | | - this.$.divFullSearch.style.display="none"; |
432 | | - this.$.siteSearchHeader.style.display="none"; |
433 | | - this.$.siteSearchNarrow.style.display="block"; |
434 | | - this.$.divContainerNarrowSearch.innerHTML=this.$.divFullSearch.innerHTML; |
| 502 | + |
| 503 | + if(this.$.siteSearchHeader.dataset.state!="closed"){ |
| 504 | + this.toggleSearchPanel(); |
| 505 | + } |
435 | 506 |
|
436 | | - } |
437 | | - else{ |
438 | | - this.$.siteSearchNarrow.dataset.toggle="off"; |
439 | | - this.$.divFullSearch.style.display="block"; |
440 | | - this.$.siteSearchHeader.style.display="block"; |
441 | | - this.$.divContainerNarrowSearch.style.height="0px"; |
442 | | - this.$.siteSearchNarrow.style.display="none"; |
443 | | - this.$.divContainerNarrowSearch.innerHTML=""; |
444 | | - this.$.divContainerNarrowSearch.paddingTop="0px"; |
445 | | - } |
| 507 | + this.headerPanelNarrow=this.queryMatchesStep2; |
| 508 | + |
| 509 | + if(this.headerPanelNarrow) |
| 510 | + this.$.headerUserInfo.style.display="none"; |
| 511 | + else |
| 512 | + this.$.headerUserInfo.style.display="block"; |
| 513 | + |
| 514 | + |
446 | 515 | }, |
447 | 516 | siteSearchHeaderAnimationEnd:function(){ |
448 | 517 | this.$.siteSearchHeader.className=""; |
449 | 518 | if(this.$.siteSearchHeader.dataset.state=="open"){ |
450 | 519 | this.$.siteSearchHeader.icon="arrow-back"; |
| 520 | + if(!this.headerPanelNarrow){ |
| 521 | + this.$.divFullSearch.className="divFullSearchOpen"; |
| 522 | + } |
451 | 523 | } |
452 | 524 | else{ |
453 | 525 | this.$.siteSearchHeader.icon="search"; |
| 526 | + this.$.siteSearchNarrow.style.display="none"; |
454 | 527 | } |
455 | 528 |
|
456 | 529 | } |
|
0 commit comments