Guest User

Untitled

a guest
Dec 8th, 2016
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.05 KB | None | 0 0
  1. diff --git a/chrome/browser/resources/settings/controls/dialog_drawer.html b/chrome/browser/resources/settings/controls/dialog_drawer.html
  2. index 0843b20..59ae875 100644
  3. --- a/chrome/browser/resources/settings/controls/dialog_drawer.html
  4. +++ b/chrome/browser/resources/settings/controls/dialog_drawer.html
  5. @@ -7,7 +7,6 @@
  6.          background-color: #FFF;
  7.          border: none;
  8.          bottom: 0;
  9. -        height: 100%;
  10.          left: -265px;
  11.          margin: 0;
  12.          overflow: hidden;
  13. @@ -18,6 +17,10 @@
  14.          width: 256px;
  15.        }
  16.  
  17. +      :host, #container {
  18. +        height: 100%;
  19. +      }
  20. +
  21.        :host(.opening) {
  22.          left: 0;
  23.        }
  24. @@ -47,7 +50,9 @@
  25.          opacity: 1;
  26.        }
  27.      </style>
  28. -    <content></content>
  29. +    <div id="container" on-tap="onContainerTap_">
  30. +      <content></content>
  31. +    <div>
  32.    </template>
  33.  </dom-module>
  34.  <script src="dialog_drawer.js"></script>
  35. diff --git a/chrome/browser/resources/settings/controls/dialog_drawer.js b/chrome/browser/resources/settings/controls/dialog_drawer.js
  36. index 4b422bd..4fd7fd1 100644
  37. --- a/chrome/browser/resources/settings/controls/dialog_drawer.js
  38. +++ b/chrome/browser/resources/settings/controls/dialog_drawer.js
  39. @@ -51,20 +51,16 @@ Polymer({
  40.      }
  41.    },
  42.  
  43. -  /**
  44. -   * Listens for a tap event outside the dialog in order to close it.
  45. -   * @param {Event} event
  46. -   * @private
  47. -   */
  48. -  onDialogTap_: function(event) {
  49. -    if (event.target != this)  // Only care about self.
  50. -      return;
  51. -
  52. -    var rect = this.getBoundingClientRect();
  53. +  /** @private */
  54. +  onContainerTap_: function(e) {
  55. +    // Stop propagation on any event inside the container, such that events
  56. +    // |onDialogTap_| is only triggered when clicking outside of the dialog.
  57. +    e.stopPropagation();
  58. +  },
  59.  
  60. -    // We can ignore checking top/bottom because dialog is height 100%.
  61. -    if (event.detail.x < rect.left || event.detail.x > rect.right)
  62. -      this.closeDrawer();
  63. +  /** @private */
  64. +  onDialogTap_: function() {
  65. +    this.closeDrawer();
  66.    },
  67.  
  68.    /**
Advertisement
Add Comment
Please, Sign In to add comment