Aligned the main menu to the right of the jsoneditor instead of the right of the page (so the menu is not located above the ad).

This commit is contained in:
josdejong 2013-02-21 08:54:25 +01:00
parent d3f604a790
commit d9a561b695
5 changed files with 15 additions and 11 deletions

View File

@ -185,11 +185,11 @@ a.header {
color: white; color: white;
text-decoration: none; text-decoration: none;
} }
a.footer, a.adInfo { a.footer {
color: #BFBFBF; color: #BFBFBF;
text-decoration: none; text-decoration: none;
} }
a.footer:hover, a.adInfo:hover { a.footer:hover {
color: red; color: red;
text-decoration: underline; text-decoration: underline;
} }

View File

@ -26,7 +26,7 @@
* Copyright (C) 2011-2013 Jos de Jong, http://jsoneditoronline.org * Copyright (C) 2011-2013 Jos de Jong, http://jsoneditoronline.org
* *
* @author Jos de Jong, <wjosdejong@gmail.com> * @author Jos de Jong, <wjosdejong@gmail.com>
* @date 2013-02-20 * @date 2013-02-21
*/ */
@ -291,11 +291,11 @@ app.clearFile = function () {
}; };
app.resize = function() { app.resize = function() {
var domMenu = document.getElementById('menu');
var domEditor = document.getElementById('jsoneditor'); var domEditor = document.getElementById('jsoneditor');
var domFormatter = document.getElementById('jsonformatter'); var domFormatter = document.getElementById('jsonformatter');
var domSplitter = document.getElementById('splitter'); var domSplitter = document.getElementById('splitter');
var domAd = document.getElementById('ad'); var domAd = document.getElementById('ad');
var domAdInfo = document.getElementById('adInfo');
var width = window.innerWidth || document.body.offsetWidth || document.documentElement.offsetWidth; var width = window.innerWidth || document.body.offsetWidth || document.documentElement.offsetWidth;
var height = window.innerHeight || document.body.offsetHeight || document.documentElement.offsetHeight; var height = window.innerHeight || document.body.offsetHeight || document.documentElement.offsetHeight;
@ -318,9 +318,13 @@ app.resize = function() {
domEditor.style.width = Math.round(width - splitterLeft - splitterWidth - 1) + 'px'; domEditor.style.width = Math.round(width - splitterLeft - splitterWidth - 1) + 'px';
} }
// resize ad text // align main menu with ads
if (domAdInfo && domAd) { if (domMenu) {
var infoHeight = domAdInfo.clientHeight; if (adWidth) {
domAd.style.paddingTop = infoHeight + 'px'; domMenu.style.right = (15 + (adWidth + 15)) + 'px';
}
else {
domMenu.style.right = 15 + 'px';
}
} }
}; };

View File

@ -37,7 +37,7 @@
Copyright (C) 2011-2013 Jos de Jong, http://jsoneditoronline.org Copyright (C) 2011-2013 Jos de Jong, http://jsoneditoronline.org
@author Jos de Jong, <wjosdejong@gmail.com> @author Jos de Jong, <wjosdejong@gmail.com>
@date 2013-02-20 @date 2013-02-21
--> -->
<meta name="description" content="JSON Editor Online is a web-based tool to view, edit, and format JSON. It shows your data side by side in a clear, editable treeview and in formatted plain text."> <meta name="description" content="JSON Editor Online is a web-based tool to view, edit, and format JSON. It shows your data side by side in a clear, editable treeview and in formatted plain text.">

View File

@ -3,7 +3,7 @@
http://jsoneditoronline.org http://jsoneditoronline.org
## 2013-02-20, version 2.0.1 ## 2013-02-21, version 2.0.1
- Fixed undefined variable in the redo method. - Fixed undefined variable in the redo method.
- Removed the "hide ads" button. Not allowed by Google AdSense, sorry. - Removed the "hide ads" button. Not allowed by Google AdSense, sorry.

View File

@ -27,7 +27,7 @@
* Copyright (c) 2011-2013 Jos de Jong, http://jsoneditoronline.org * Copyright (c) 2011-2013 Jos de Jong, http://jsoneditoronline.org
* *
* @author Jos de Jong, <wjosdejong@gmail.com> * @author Jos de Jong, <wjosdejong@gmail.com>
* @date 2013-02-20 * @date 2013-02-21
*/ */
(function () { (function () {