Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: chrome/browser/resources/settings/controls/dialog_drawer.js

Issue 2628123002: MD WebUI: Move settings' dialog-drawer element into a shared cr-element (Closed)
Patch Set: Rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/controls/dialog_drawer.js
diff --git a/chrome/browser/resources/settings/controls/dialog_drawer.js b/chrome/browser/resources/settings/controls/dialog_drawer.js
deleted file mode 100644
index dadad46494b470eba9c68d8d14fdfa5eb69acd83..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/settings/controls/dialog_drawer.js
+++ /dev/null
@@ -1,92 +0,0 @@
-// 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({
- is: 'dialog-drawer',
- extends: 'dialog',
-
- properties: {
- /** Enables notifications for |Dialog.open|. */
- open: {
- type: Boolean,
- notify: true,
- },
-
- /** The alignment of the drawer on the screen ('left' or 'right'). */
- align: {
- type: String,
- value: 'left',
- reflectToAttribute: true,
- },
- },
-
- listeners: {
- 'cancel': 'onDialogCancel_',
- 'tap': 'onDialogTap_',
- 'transitionend': 'onDialogTransitionEnd_',
- },
-
- /** Toggles the drawer open and close. */
- toggle: function() {
- if (this.open)
- this.closeDrawer();
- else
- this.openDrawer();
- },
-
- /** Shows drawer and slides it into view. */
- openDrawer: function() {
- if (!this.open) {
- this.showModal();
- this.classList.add('opening');
- }
- },
-
- /** Slides the drawer away, then closes it after the transition has ended. */
- closeDrawer: function() {
- if (this.open) {
- this.classList.remove('opening');
- this.classList.add('closing');
- }
- },
-
- /**
- * Stop propagation of a tap event inside the container. This will allow
- * |onDialogTap_| to only be called when clicked outside the container.
- * @param {!Event} event
- * @private
- */
- onContainerTap_: function(event) {
- event.stopPropagation();
- },
-
- /**
- * Close the dialog when tapped outside the container.
- * @private
- */
- onDialogTap_: function() {
- this.closeDrawer();
- },
-
- /**
- * Overrides the default cancel machanism to allow for a close animation.
- * @param {!Event} event
- * @private
- */
- onDialogCancel_: function(event) {
- event.preventDefault();
- this.closeDrawer();
- },
-
- /**
- * Closes the dialog when the closing animation is over.
- * @private
- */
- onDialogTransitionEnd_: function() {
- if (this.classList.contains('closing')) {
- this.classList.remove('closing');
- this.close();
- }
- },
-});

Powered by Google App Engine
This is Rietveld 408576698