| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.SidebarPane} | 33 * @extends {WebInspector.SidebarPane} |
| 34 * @param {string} title |
| 34 */ | 35 */ |
| 35 WebInspector.BreakpointsSidebarPaneBase = function(title) | 36 WebInspector.BreakpointsSidebarPaneBase = function(title) |
| 36 { | 37 { |
| 37 WebInspector.SidebarPane.call(this, title); | 38 WebInspector.SidebarPane.call(this, title); |
| 38 this.registerRequiredCSS("components/breakpointsList.css"); | 39 this.registerRequiredCSS("components/breakpointsList.css"); |
| 39 | 40 |
| 40 this.listElement = createElement("ol"); | 41 this.listElement = createElement("ol"); |
| 41 this.listElement.className = "breakpoint-list"; | 42 this.listElement.className = "breakpoint-list"; |
| 42 | 43 |
| 43 this.emptyElement = createElement("div"); | 44 this.emptyElement = createElement("div"); |
| 44 this.emptyElement.className = "info"; | 45 this.emptyElement.className = "info"; |
| 45 this.emptyElement.textContent = WebInspector.UIString("No Breakpoints"); | 46 this.emptyElement.textContent = WebInspector.UIString("No Breakpoints"); |
| 46 | 47 |
| 47 this.bodyElement.appendChild(this.emptyElement); | 48 this.element.appendChild(this.emptyElement); |
| 48 } | 49 } |
| 49 | 50 |
| 50 WebInspector.BreakpointsSidebarPaneBase.prototype = { | 51 WebInspector.BreakpointsSidebarPaneBase.prototype = { |
| 51 /** | 52 /** |
| 52 * @param {!Element} element | 53 * @param {!Element} element |
| 53 * @param {?Node=} beforeNode | 54 * @param {?Node=} beforeNode |
| 54 * @protected | 55 * @protected |
| 55 */ | 56 */ |
| 56 addListElement: function(element, beforeNode) | 57 addListElement: function(element, beforeNode) |
| 57 { | 58 { |
| 58 if (beforeNode) { | 59 if (beforeNode) { |
| 59 this.listElement.insertBefore(element, beforeNode); | 60 this.listElement.insertBefore(element, beforeNode); |
| 60 } else { | 61 } else { |
| 61 if (!this.listElement.firstChild) { | 62 if (!this.listElement.firstChild) { |
| 62 this.bodyElement.removeChild(this.emptyElement); | 63 this.element.removeChild(this.emptyElement); |
| 63 this.bodyElement.appendChild(this.listElement); | 64 this.element.appendChild(this.listElement); |
| 64 } | 65 } |
| 65 this.listElement.appendChild(element); | 66 this.listElement.appendChild(element); |
| 66 } | 67 } |
| 67 }, | 68 }, |
| 68 | 69 |
| 69 /** | 70 /** |
| 70 * @param {!Element} element | 71 * @param {!Element} element |
| 71 * @protected | 72 * @protected |
| 72 */ | 73 */ |
| 73 removeListElement: function(element) | 74 removeListElement: function(element) |
| 74 { | 75 { |
| 75 this.listElement.removeChild(element); | 76 this.listElement.removeChild(element); |
| 76 if (!this.listElement.firstChild) { | 77 if (!this.listElement.firstChild) { |
| 77 this.bodyElement.removeChild(this.listElement); | 78 this.element.removeChild(this.listElement); |
| 78 this.bodyElement.appendChild(this.emptyElement); | 79 this.element.appendChild(this.emptyElement); |
| 79 } | 80 } |
| 80 }, | 81 }, |
| 81 | 82 |
| 82 /** | 83 /** |
| 83 * @protected | 84 * @protected |
| 84 */ | 85 */ |
| 85 reset: function() | 86 reset: function() |
| 86 { | 87 { |
| 87 this.listElement.removeChildren(); | 88 this.listElement.removeChildren(); |
| 88 if (this.listElement.parentElement) { | 89 if (this.listElement.parentElement) { |
| 89 this.bodyElement.removeChild(this.listElement); | 90 this.element.removeChild(this.listElement); |
| 90 this.bodyElement.appendChild(this.emptyElement); | 91 this.element.appendChild(this.emptyElement); |
| 91 } | 92 } |
| 92 }, | 93 }, |
| 93 | 94 |
| 94 __proto__: WebInspector.SidebarPane.prototype | 95 __proto__: WebInspector.SidebarPane.prototype |
| 95 } | 96 } |
| OLD | NEW |