api-console-assets
Version:
This repo only exists to publish api console components to npm
69 lines (66 loc) • 2.08 kB
HTML
<!--
@license
Copyright 2016 The Advanced REST client authors <arc@mulesoft.com>
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->
<script>
(function(g) {
'use strict';
g.RamlBehaviors = g.RamlBehaviors || {};
/**
* Common properties and methods narrow full screen panels.
*
* @polymerBehavior RamlBehaviors.PathSelectorBehavior
*/
g.RamlBehaviors.PathSelectorBehavior = {
/**
* Fired when the user requested "back" in the tree structure.
*
* @event raml-path-selector-nav-back
*/
properties: {
// Currently selected path.
selectedPath: String,
// If set this view is being displayed. It will animate entry or exit.
opened: {
type: Boolean,
observer: '_openedChanged'
},
// Number of pixels to indent the content.
indentSize: Number
},
// Fires the `raml-path-selector-nav-back` event.
back: function() {
this.fire('raml-path-selector-nav-back');
},
/**
* Animates entry / exit for the panel.
*/
_openedChanged: function(opened) {
if (opened) {
this.style.display = 'block';
if (this.__closeTimer) {
this.cancelAsync(this.__closeTimer);
this.__closeTimer = undefined;
}
Polymer.RenderStatus.afterNextRender(this, function() {
this.transform('translate3d(0, 0, 0)');
});
} else {
this.transform('translate3d(100%, 0, 0)');
this.__closeTimer = this.async(function() {
this.style.display = 'none';
}, 300);
}
}
};
})(window);
</script>