feature(panel) id -> data-name

This commit is contained in:
coderaiser 2015-04-24 08:34:56 -04:00
parent 748bb1b7b2
commit 8a97369103
3 changed files with 12 additions and 12 deletions

View file

@ -1 +1 @@
<section id="js-{{ side }}" class="panel panel-{{ side }}">{{ content }}</section>
<section data-name="js-{{ side }}" class="panel panel-{{ side }}">{{ content }}</section>

View file

@ -1373,16 +1373,16 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
* @param options = {active: true}
*/
this.getPanel = function(options) {
var id = 'js-',
var dataName = 'js-',
current = this.getCurrentFile(),
files = current.parentElement,
panel = files.parentElement,
isLeft = panel.id === 'js-left';
isLeft = panel.getAttribute('data-name') === 'js-left';
/* if {active : false} getting passive panel */
if (options && !options.active) {
id += isLeft ? 'right' : 'left';
panel = this.getById(id);
dataName += isLeft ? 'right' : 'left';
panel = this.getByDataName(dataName);
}
/* if two panels showed
@ -1390,7 +1390,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
* panel
*/
if (window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH)
panel = this.getById('js-left');
panel = this.getByDataName('js-left');
if (!panel)
@ -1730,19 +1730,19 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
};
this.changePanel = function() {
var id, files, name,
var dataName, files, name,
Info = CurrentInfo,
current = Info.element,
panel = Info.panel,
filesPassive = Info.filesPassive;
id = panel.id;
TabPanel[id] = current;
dataName = panel.getAttribute('data-name');
TabPanel[dataName] = current;
panel = Info.panelPassive;
id = panel.id;
dataName = panel.getAttribute('data-name');
current = TabPanel[id];
current = TabPanel[dataName];
if (current)
files = current.parentElement;

View file

@ -65,7 +65,7 @@ var Util, DOM, CloudFunc, CloudCmd;
pathElement;
if (typeof side === 'string')
panel = DOM.getById('js-' + side);
panel = DOM.getByDataName('js-' + side);
else
panel = side;