feature(dom) resize: set current file on left panel, when right panel is active on resizing, and size is to small for two panels

This commit is contained in:
coderaiser 2015-06-02 05:09:33 -04:00
parent ff471d0ba4
commit bd7259cfe4

View file

@ -22,6 +22,7 @@ var Util, DOM, CloudFunc, CloudCmd;
dragndrop();
unload();
pop();
resize();
};
this.initKeysPanel = function() {
@ -296,6 +297,17 @@ var Util, DOM, CloudFunc, CloudCmd;
});
}
function resize() {
Events.add('resize', function() {
var is = window.innerWidth < CloudCmd.MIN_ONE_PANEL_WIDTH,
name = Info.panel.getAttribute('data-name'),
isLeft = name === 'js-left';
if (is && !isLeft)
DOM.changePanel();
});
}
}
})(Util, DOM, CloudFunc, CloudCmd);