[common] added nessesary utils

This commit is contained in:
Maxim Kadushkin 2018-01-23 20:33:59 +03:00
parent d184c3f647
commit 106afacb6e
2 changed files with 28 additions and 1 deletions

View file

@ -185,6 +185,13 @@ define([
return parseInt(el.css('width')); return parseInt(el.css('width'));
}, },
getItem: function (alias) {
for (var p in this.panels) {
var panel = this.panels[p];
if ( panel.alias == alias ) return panel;
}
},
onSelectStart: function(e) { onSelectStart: function(e) {
if (e.preventDefault) e.preventDefault(); if (e.preventDefault) e.preventDefault();
return false; return false;

View file

@ -736,3 +736,23 @@ String.prototype.strongMatch = function(regExp){
return false; return false;
}; };
Common.Utils.InternalSettings = new(function() {
var settings = {};
var _get = function(name) {
return settings[name];
},
_set = function(name, value) {
settings[name] = value;
};
return {
get: _get,
set: _set
}
});
Common.Utils.InternalSettings.set('toolbar-height-compact', 32);
Common.Utils.InternalSettings.set('toolbar-height-normal', 32+67);
Common.Utils.InternalSettings.set('doc-title-height', 26);