1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 05:18:32 +01:00

refactoring, fixed coding conventions

This commit is contained in:
maximebf 2014-02-14 11:49:37 -03:00
parent cff4a0fce6
commit 9efc22aca1
2 changed files with 14 additions and 14 deletions

View File

@ -177,6 +177,7 @@ div.phpdebugbar-panel.phpdebugbar-active {
}
/* -------------------------------------- */
div.phpdebugbar-mini-design a.phpdebugbar-tab {
position: relative;
border-right: 1px solid #ddd;

View File

@ -419,26 +419,23 @@ if (typeof(PhpDebugBar) == 'undefined') {
* Resizes the debugbar to fit the current browser window
*/
resize: function() {
var $ = PhpDebugBar.$;
var header = $(".phpdebugbar-header");
var contentSize = this.respCSSSize;
if (this.respCSSSize == 0) {
$(header).find("> *:visible").each(function () {
this.$header.find("> *:visible").each(function () {
contentSize += $(this).outerWidth();
});
}
var currentSize = $(header).width();
var currentSize = this.$header.width();
var cssClass = "phpdebugbar-mini-design";
var bool = this.$header.hasClass(cssClass);
var cssClass = "phpdebugbar-mini-design", bool = $(header).hasClass(cssClass);
if (currentSize <= contentSize && !bool) {
this.respCSSSize = contentSize;
$(header).addClass(cssClass);
this.$header.addClass(cssClass);
} else if (contentSize < currentSize && bool) {
this.respCSSSize = 0;
$(".phpdebugbar-header").removeClass(cssClass);
this.$header.removeClass(cssClass);
}
},
@ -522,9 +519,9 @@ if (typeof(PhpDebugBar) == 'undefined') {
// bar visibility
var open = localStorage.getItem('phpdebugbar-open');
if(open && open == '0'){
if (open && open == '0') {
this.close();
}else{
} else {
var visible = localStorage.getItem('phpdebugbar-visible');
if (visible && visible == '1') {
var tab = localStorage.getItem('phpdebugbar-tab');
@ -719,6 +716,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.$el.removeClass(csscls('minimized'));
localStorage.setItem('phpdebugbar-visible', '1');
localStorage.setItem('phpdebugbar-tab', name);
this.resize();
},
/**
@ -733,6 +731,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
this.recomputeBottomOffset();
localStorage.setItem('phpdebugbar-visible', '0');
this.$el.addClass(csscls('minimized'));
this.resize();
},
/**
@ -1009,9 +1008,9 @@ if (typeof(PhpDebugBar) == 'undefined') {
}
var data = this.parseHeaders(raw);
if(data.error){
throw new Error('Error loading debugbar data: '+data.error);
}else if(data.data){
if (data.error) {
throw new Error('Error loading debugbar data: ' + data.error);
} else if(data.data) {
this.debugbar.addDataSet(data.data, data.id, "(ajax)");
}
return true;