aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Project/projectpanelbase.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Project/projectpanelbase.reel')
-rwxr-xr-xjs/panels/Project/projectpanelbase.reel/ProjectPanelBase.js315
-rwxr-xr-xjs/panels/Project/projectpanelbase.reel/projectpanelbase.html23
2 files changed, 170 insertions, 168 deletions
diff --git a/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js b/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js
index 51aebc31..c1141ba6 100755
--- a/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js
+++ b/js/panels/Project/projectpanelbase.reel/ProjectPanelBase.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -40,7 +41,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
40 numerable: false, 41 numerable: false,
41 value: false 42 value: false
42 }, 43 },
43 44
44 /* The current project that we have in memory */ 45 /* The current project that we have in memory */
45 _activeProject: { 46 _activeProject: {
46 value: false 47 value: false
@@ -53,7 +54,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
53 this._activeProject = objNewProject; 54 this._activeProject = objNewProject;
54 } 55 }
55 }, 56 },
56 57
57 /* Is the panel initialized? Helps keep us from re-initializing things when a project switches */ 58 /* Is the panel initialized? Helps keep us from re-initializing things when a project switches */
58 _isPanelInitialized: { 59 _isPanelInitialized: {
59 value: false 60 value: false
@@ -66,7 +67,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
66 this._isPanelInitialized = boolValue; 67 this._isPanelInitialized = boolValue;
67 } 68 }
68 }, 69 },
69 70
70 /* Project models: is there an active project, did the user just swap the project, etc. */ 71 /* Project models: is there an active project, did the user just swap the project, etc. */
71 _swapProject: { 72 _swapProject: {
72 value: false 73 value: false
@@ -122,7 +123,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
122 this.hasActiveProject = myVal; 123 this.hasActiveProject = myVal;
123 } 124 }
124 }, 125 },
125 126
126 /* Focus monitor: needed to modify keyboard navigation through panels. */ 127 /* Focus monitor: needed to modify keyboard navigation through panels. */
127 _hasFocus: { 128 _hasFocus: {
128 value: false 129 value: false
@@ -168,7 +169,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
168 } 169 }
169 } 170 }
170 } 171 }
171 }, 172 },
172 173
173 /* resizeColumn: Method to resize a column */ 174 /* resizeColumn: Method to resize a column */
174 resizeColumn: { 175 resizeColumn: {
@@ -186,7 +187,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
186 strNewWidth = "", 187 strNewWidth = "",
187 boolProjectView = true, 188 boolProjectView = true,
188 arrStoredWidths = this.panelState.projectColumnWidths; 189 arrStoredWidths = this.panelState.projectColumnWidths;
189 190
190 if (strSelectorBase.indexOf("assets") > -1) { 191 if (strSelectorBase.indexOf("assets") > -1) {
191 boolProjectView = false; 192 boolProjectView = false;
192 arrStoredWidths = this.panelState.assetColumnWidths; 193 arrStoredWidths = this.panelState.assetColumnWidths;
@@ -211,12 +212,12 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
211 if ((this.activeColumn === 3) && boolProjectView) { 212 if ((this.activeColumn === 3) && boolProjectView) {
212 return; 213 return;
213 } 214 }
214 215
215 // Adjust intAdjust: for the asset view it needs to be 0. 216 // Adjust intAdjust: for the asset view it needs to be 0.
216 if (strSelectorBase.indexOf("assets") >0) { 217 if (strSelectorBase.indexOf("assets") >0) {
217 intAdjust = 0; 218 intAdjust = 0;
218 } 219 }
219 220
220 // Get the total width of the headers and set the container to that width. 221 // Get the total width of the headers and set the container to that width.
221 for (i = 0; i < arrHeadersLength; i++) { 222 for (i = 0; i < arrHeadersLength; i++) {
222 intTotalWidth = intTotalWidth + parseInt(arrHeaders[i].offsetWidth); 223 intTotalWidth = intTotalWidth + parseInt(arrHeaders[i].offsetWidth);
@@ -235,14 +236,14 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
235 intNewWidth = arrStoredWidths[this.activeColumn]; 236 intNewWidth = arrStoredWidths[this.activeColumn];
236 } 237 }
237 strNewWidth = (intNewWidth - intAdjust) + "px"; 238 strNewWidth = (intNewWidth - intAdjust) + "px";
238 239
239 // Get the array of column elements to change, and change them 240 // Get the array of column elements to change, and change them
240 arrToChange = document.querySelectorAll(strSelector); 241 arrToChange = document.querySelectorAll(strSelector);
241 arrToChangeLength = arrToChange.length; 242 arrToChangeLength = arrToChange.length;
242 for (i = 0; i < arrToChangeLength; i++) { 243 for (i = 0; i < arrToChangeLength; i++) {
243 arrToChange[i].style.width = strNewWidth; 244 arrToChange[i].style.width = strNewWidth;
244 } 245 }
245 246
246 // Once resize has been completed, we need to update the panelState object: 247 // Once resize has been completed, we need to update the panelState object:
247 if (!boolProjectView) { 248 if (!boolProjectView) {
248 this.panelState.assetColumnWidths[this.activeColumn] = intNewWidth; 249 this.panelState.assetColumnWidths[this.activeColumn] = intNewWidth;
@@ -254,13 +255,13 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
254 255
255 /* checkForResize: Check if the columns in the active view are being resized */ 256 /* checkForResize: Check if the columns in the active view are being resized */
256 checkForResize: { 257 checkForResize: {
257 value: function() { 258 value: function() {
258 var arrHeaders = document.querySelectorAll("#pp-view-" + this.panelState.activeView + " .pp-header"), 259 var arrHeaders = document.querySelectorAll("#pp-view-" + this.panelState.activeView + " .pp-header"),
259 arrHeadersLength = arrHeaders.length, 260 arrHeadersLength = arrHeaders.length,
260 i=0, 261 i=0,
261 colWidth = 0, 262 colWidth = 0,
262 arrCols = this.panelState.projectColumnWidths; 263 arrCols = this.panelState.projectColumnWidths;
263 264
264 if (this.panelState.activeView === "assets") { 265 if (this.panelState.activeView === "assets") {
265 arrCols = this.panelState.assetColumnWidths; 266 arrCols = this.panelState.assetColumnWidths;
266 } 267 }
@@ -274,7 +275,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
274 } 275 }
275 } 276 }
276 }, 277 },
277 278
278 /* Shift key status: is the shift key pressed (used for keyboard navigation and multiselect) */ 279 /* Shift key status: is the shift key pressed (used for keyboard navigation and multiselect) */
279 _isShiftKeyDown: { 280 _isShiftKeyDown: {
280 value: false 281 value: false
@@ -287,7 +288,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
287 this._isShiftKeyDown = boolValue; 288 this._isShiftKeyDown = boolValue;
288 } 289 }
289 }, 290 },
290 291
291 /* Inline editor models: is the inline editor active, and a pointer to the current one */ 292 /* Inline editor models: is the inline editor active, and a pointer to the current one */
292 _activeInlineEditor: { 293 _activeInlineEditor: {
293 value: false 294 value: false
@@ -327,7 +328,7 @@ exports.ProjectPanelBase = (require("montage/core/core").Montage).create(require
327 } 328 }
328 } 329 }
329 },