blob: 17b4d6363ba9625d01af775b3138f0a138e2d248 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Polymer({
// Not "toolbar" because element names must contain a hyphen.
is: 'os-toolbar',
properties: {
// Value is proxied through to cr-toolbar-search-field. When true,
// the search field will show a processing spinner.
spinnerActive: Boolean,
// Controls whether the menu button is shown at the start of the menu.
showMenu: {type: Boolean, value: false},
// Controls whether the search field is shown.
showSearch: {type: Boolean, value: true},
// True when the toolbar is displaying in narrow mode.
narrow: {
type: Boolean,
reflectToAttribute: true,
readonly: true,
notify: true,
},
/**
* The threshold at which the toolbar will change from normal to narrow
* mode, in px.
*/
narrowThreshold: {
type: Number,
value: 900,
},
/** @private */
showingSearch_: {
type: Boolean,
reflectToAttribute: true,
},
},
/** @return {!CrToolbarSearchFieldElement} */
getSearchField: function() {
return this.$.search;
},
/** @private */
onMenuTap_: function() {
this.fire('os-toolbar-menu-tap');
},
});