| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * | 10 * |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 this._elementDragMove = this._elementDragMove.bind(this); | 90 this._elementDragMove = this._elementDragMove.bind(this); |
| 91 this._elementDragEnd = this._elementDragEnd.bind(this); | 91 this._elementDragEnd = this._elementDragEnd.bind(this); |
| 92 this._mouseOutWhileDragging = this._mouseOutWhileDragging.bind(this); | 92 this._mouseOutWhileDragging = this._mouseOutWhileDragging.bind(this); |
| 93 } | 93 } |
| 94 | 94 |
| 95 _createGlassPane() { | 95 _createGlassPane() { |
| 96 this._glassPaneInUse = true; | 96 this._glassPaneInUse = true; |
| 97 if (!UI.DragHandler._glassPaneUsageCount++) { | 97 if (!UI.DragHandler._glassPaneUsageCount++) { |
| 98 UI.DragHandler._glassPane = new UI.GlassPane(); | 98 UI.DragHandler._glassPane = new UI.GlassPane(); |
| 99 UI.DragHandler._glassPane.setBlockPointerEvents(true); | 99 UI.DragHandler._glassPane.setBlockPointerEvents(true); |
| 100 UI.DragHandler._glassPane.showGlassPane(UI.DragHandler._documentForMouseOu
t); | 100 UI.DragHandler._glassPane.show(UI.DragHandler._documentForMouseOut); |
| 101 } | 101 } |
| 102 } | 102 } |
| 103 | 103 |
| 104 _disposeGlassPane() { | 104 _disposeGlassPane() { |
| 105 if (!this._glassPaneInUse) | 105 if (!this._glassPaneInUse) |
| 106 return; | 106 return; |
| 107 this._glassPaneInUse = false; | 107 this._glassPaneInUse = false; |
| 108 if (--UI.DragHandler._glassPaneUsageCount) | 108 if (--UI.DragHandler._glassPaneUsageCount) |
| 109 return; | 109 return; |
| 110 UI.DragHandler._glassPane.hideGlassPane(); | 110 UI.DragHandler._glassPane.hide(); |
| 111 delete UI.DragHandler._glassPane; | 111 delete UI.DragHandler._glassPane; |
| 112 delete UI.DragHandler._documentForMouseOut; | 112 delete UI.DragHandler._documentForMouseOut; |
| 113 } | 113 } |
| 114 | 114 |
| 115 /** | 115 /** |
| 116 * @param {!Element} targetElement | 116 * @param {!Element} targetElement |
| 117 * @param {?function(!MouseEvent):boolean} elementDragStart | 117 * @param {?function(!MouseEvent):boolean} elementDragStart |
| 118 * @param {function(!MouseEvent)} elementDrag | 118 * @param {function(!MouseEvent)} elementDrag |
| 119 * @param {?function(!MouseEvent)} elementDragEnd | 119 * @param {?function(!MouseEvent)} elementDragEnd |
| 120 * @param {string} cursor | 120 * @param {string} cursor |
| (...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2043 */ | 2043 */ |
| 2044 static show(where, message, callback) { | 2044 static show(where, message, callback) { |
| 2045 var dialog = new UI.Dialog(); | 2045 var dialog = new UI.Dialog(); |
| 2046 dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); | 2046 dialog.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); |
| 2047 dialog.addCloseButton(); | 2047 dialog.addCloseButton(); |
| 2048 dialog.setDimmed(true); | 2048 dialog.setDimmed(true); |
| 2049 new UI | 2049 new UI |
| 2050 .ConfirmDialog( | 2050 .ConfirmDialog( |
| 2051 message, | 2051 message, |
| 2052 () => { | 2052 () => { |
| 2053 dialog.hideDialog(); | 2053 dialog.hide(); |
| 2054 callback(); | 2054 callback(); |
| 2055 }, | 2055 }, |
| 2056 () => dialog.hideDialog()) | 2056 () => dialog.hide()) |
| 2057 .show(dialog.contentElement); | 2057 .show(dialog.contentElement); |
| 2058 dialog.showDialog(where); | 2058 dialog.show(where); |
| 2059 } | 2059 } |
| 2060 | 2060 |
| 2061 /** | 2061 /** |
| 2062 * @param {string} message | 2062 * @param {string} message |
| 2063 * @param {!Function} okCallback | 2063 * @param {!Function} okCallback |
| 2064 * @param {!Function} cancelCallback | 2064 * @param {!Function} cancelCallback |
| 2065 */ | 2065 */ |
| 2066 constructor(message, okCallback, cancelCallback) { | 2066 constructor(message, okCallback, cancelCallback) { |
| 2067 super(true); | 2067 super(true); |
| 2068 this.registerRequiredCSS('ui/confirmDialog.css'); | 2068 this.registerRequiredCSS('ui/confirmDialog.css'); |
| 2069 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; | 2069 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; |
| 2070 var buttonsBar = this.contentElement.createChild('div', 'button'); | 2070 var buttonsBar = this.contentElement.createChild('div', 'button'); |
| 2071 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); | 2071 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); |
| 2072 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); | 2072 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); |
| 2073 } | 2073 } |
| 2074 }; | 2074 }; |
| OLD | NEW |