| 1 | /*
|
|---|
| 2 |
|
|---|
| 3 | Copyright (C) 2016 - 2018 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
|
|---|
| 4 |
|
|---|
| 5 | This library is free software; you can redistribute it and/or
|
|---|
| 6 | modify it under the terms of the GNU Lesser General Public
|
|---|
| 7 | License as published by the Free Software Foundation; either
|
|---|
| 8 | version 2.1 of the License, or (at your option) any later version.
|
|---|
| 9 |
|
|---|
| 10 | This library is distributed in the hope that it will be useful,
|
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 13 | Lesser General Public License for more details.
|
|---|
| 14 |
|
|---|
| 15 | You should have received a copy of the GNU Lesser General Public
|
|---|
| 16 | License along with this library; if not, write to the Free Software
|
|---|
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|---|
| 18 | MA 02110-1301 USA.
|
|---|
| 19 |
|
|---|
| 20 | */
|
|---|
| 21 |
|
|---|
| 22 | /** @namespace GnuBoat JavaScript namespace */
|
|---|
| 23 | var GnuBoat = GnuBoat || {};
|
|---|
| 24 |
|
|---|
| 25 | /**
|
|---|
| 26 | * @brief Used to display user messages
|
|---|
| 27 | */
|
|---|
| 28 | GnuBoat.displayMessage = function(text)
|
|---|
| 29 | {
|
|---|
| 30 | $("#message").empty();
|
|---|
| 31 | $(text).appendTo("#message");
|
|---|
| 32 | location.hash = "#messages";
|
|---|
| 33 | }
|
|---|
| 34 |
|
|---|
| 35 | GnuBoat.menuSetup = function()
|
|---|
| 36 | {
|
|---|
| 37 | var active = 'active';
|
|---|
| 38 | var layout = null;
|
|---|
| 39 | var menu = null;
|
|---|
| 40 | var menuLink = null;
|
|---|
| 41 | var content = null;
|
|---|
| 42 |
|
|---|
| 43 | function toggleAll() {
|
|---|
| 44 | layout.toggleClass(active);
|
|---|
| 45 | menu.toggleClass(active);
|
|---|
| 46 | menuLink.toggleClass(active);
|
|---|
| 47 | }
|
|---|
| 48 |
|
|---|
| 49 | $(document).ready(function () {
|
|---|
| 50 | layout = $("#layout");
|
|---|
| 51 | menu = $("#menu");
|
|---|
| 52 | menuLink = $("#menuLink");
|
|---|
| 53 | content = $("#main");
|
|---|
| 54 |
|
|---|
| 55 | menuLink.click(function () {
|
|---|
| 56 | toggleAll();
|
|---|
| 57 | });
|
|---|
| 58 |
|
|---|
| 59 | content.click(function() {
|
|---|
| 60 | if (menu.hasClass(active)) {
|
|---|
| 61 | toggleAll();
|
|---|
| 62 | }
|
|---|
| 63 | });
|
|---|
| 64 | });
|
|---|
| 65 | }
|
|---|