refactor(client) mv panel height to index

This commit is contained in:
coderaiser 2013-11-28 15:39:00 +00:00
parent 1cfab411e2
commit 8c3075eabf
2 changed files with 26 additions and 22 deletions

View file

@ -32,7 +32,7 @@
(function() {
'use strict';
var script,
var script, Height,
files = [
'lib/client/listeners.js',
'lib/client.js',
@ -43,6 +43,7 @@
url = getCombineURL(files);
window.addEventListener('load', createScript);
setPanelHeight();
function createScript() {
script = document.createElement('script');
@ -69,8 +70,32 @@
function scriptLoad() {
CloudCmd.init();
CloudCmd.HEIGHT = Height;
script.removeEventListener('load', scriptLoad);
}
function setPanelHeight() {
var style;
/* устанавливаем размер высоты таблицы файлов
* исходя из размеров разрешения экрана
*
* формируем и округляем высоту экрана
* при разрешениии 1024x1280:
* 658 -> 700
*/
Height = window.screen.height;
Height -= (Height / 3).toFixed();
Height = (Height / 100).toFixed() * 100;
style = document.createElement('style');
style.innerText = '.panel {' +
'height:' + Height +'px;' +
'}';
document.head.appendChild(style);
}
})();
</script>
</body>

View file

@ -122,27 +122,6 @@ var Util, DOM, CloudFunc, CloudCmd;
*/
CloudCmd.init = function() {
var lCallBack, lFunc, lHeight;
/* устанавливаем размер высоты таблицы файлов
* исходя из размеров разрешения экрана
*
* формируем и округляем высоту экрана
* при разрешениии 1024x1280:
* 658 -> 700
*/
lHeight = window.screen.height;
lHeight = lHeight - (lHeight/3).toFixed();
lHeight = (lHeight / 100).toFixed() * 100;
CloudCmd.HEIGHT = lHeight;
DOM.cssSet({
id:'cloudcmd',
inner:
'.panel{' +
'height:' + lHeight +'px;' +
'}'
});
lCallBack = function() {
Util.loadOnLoad([