From 448d32a873b8b6627e05f07e699d52c2c90c25e3 Mon Sep 17 00:00:00 2001 From: Matthieu Lalonde Date: Fri, 2 Nov 2012 18:44:38 -0400 Subject: [PATCH] \! --- resources/css/app.css | 34 ++++++++++++------------ resources/js/app.js | 9 ++++--- resources/js/views/browser.js | 1 - resources/js/views/client.js | 9 +++---- resources/js/views/main.js | 11 +++----- resources/js/views/sidebar.js | 2 ++ resources/templates/app/modal-login.html | 10 +++---- resources/templates/client/layout.html | 24 ++++++++--------- 8 files changed, 49 insertions(+), 51 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 1bd3762..d2df1c9 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -178,44 +178,44 @@ body > .ui-layout-center > div { display: block; } - body > .ui-layout-center > div > div:first { + body > .ui-layout-center > div { margin: 0; padding: 0; background: #FFF url(../img/grid3-hrow2.gif) repeat-x; } - body > .ui-layout-center > div > div:first > div.third { + body > .ui-layout-center > div > div.third { width: 33.3333%; float: left; clear: none; } - body > .ui-layout-center > div > div:first > div.third:first-child { + body > .ui-layout-center > div > div.third:first-child { clear: left; } - body > .ui-layout-center > div > div:first > div.third:last-child { + body > .ui-layout-center > div > div.third:last-child { clear: right; } - body > .ui-layout-center > div > div:first > div.third > div.dataTables_wrapper, - body > .ui-layout-center > div > div:first > div.third > div.dataTables_wrapper { + body > .ui-layout-center > div > div.third > div.dataTables_wrapper, + body > .ui-layout-center > div > div.third > div.dataTables_wrapper { border-left: 1px solid #C6C6C6; } - body > .ui-layout-center > div > div:first > div:first-child > div.dataTables_wrapper, - body > .ui-layout-center > div > div:first > div:first-child > div.dataTables_wrapper { + body > .ui-layout-center > div > div:first-child > div.dataTables_wrapper, + body > .ui-layout-center > div > div:first-child > div.dataTables_wrapper { border-left: none; padding-left: 1px; } - body > .ui-layout-center > div > div:first > div.third > div.dataTables_wrapper table td { + body > .ui-layout-center > div > div.third > div.dataTables_wrapper table td { padding-left: 4px; } - body > .ui-layout-center > div > div:first table.dataTable tr td.sorting_1 { background-color: transparent; } - body > .ui-layout-center > div > div:first table.dataTable tr td.sorting_2 { background-color: transparent; } - body > .ui-layout-center > div > div:first table.dataTable tr td.sorting_3 { background-color: transparent; } + body > .ui-layout-center > div table.dataTable tr td.sorting_1 { background-color: transparent; } + body > .ui-layout-center > div table.dataTable tr td.sorting_2 { background-color: transparent; } + body > .ui-layout-center > div table.dataTable tr td.sorting_3 { background-color: transparent; } .ui-layout-center .client-view-container { @@ -344,7 +344,7 @@ div.dataTables_scrollHeadInner th { border: none; } - body > .ui-layout-center > div > div:first div.dataTables_scrollHeadInner th { + body > .ui-layout-center > div div.dataTables_scrollHeadInner th { padding-left: 4px; } @@ -361,10 +361,10 @@ table.dataTable tbody tr.selected td, table.dataTable tbody tr.selected td.sorting_1, table.dataTable tbody tr.selected td.sorting_2, table.dataTable tbody tr.selected td.sorting_3, -body > .ui-layout-center > div > div:first > div.third > div.dataTables_wrapper table tr.selected td, -body > .ui-layout-center > div > div:first > div.third > div.dataTables_wrapper table tr.selected td.sorting_1, -body > .ui-layout-center > div > div:first > div.third > div.dataTables_wrapper table tr.selected td.sorting_2, -body > .ui-layout-center > div > div:first > div.third > div.dataTables_wrapper table tr.selected td.sorting_3, +body > .ui-layout-center > div > div.third > div.dataTables_wrapper table tr.selected td, +body > .ui-layout-center > div > div.third > div.dataTables_wrapper table tr.selected td.sorting_1, +body > .ui-layout-center > div > div.third > div.dataTables_wrapper table tr.selected td.sorting_2, +body > .ui-layout-center > div > div.third > div.dataTables_wrapper table tr.selected td.sorting_3, .dropdown-menu * a:hover, .dropdown-menu * a:focus, .dropdown-menu * li:hover, diff --git a/resources/js/app.js b/resources/js/app.js index de88be4..dacff1c 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -178,7 +178,7 @@ _ pushState: true , root: Config.docRoot }); -console.log(Bootstrap); + // For now let's reset the state when we start up //that.navigate("", false); @@ -211,13 +211,14 @@ console.log(Bootstrap); if (server && client) { that.Views.SideBar.select(server); - + // FIXME: This needs to take client states into account var __fnAppEventClientLoaded = function () { if (!that.Views.Main.getView(server.get("hostname"))) { + console.log(server); that.Views.Main.setView(server.client.attributes.hostname, new ClientView({ /*el: that.Views.App.Layout.panes.center , */server: server - , aoppendEl: that.Views.App.Layout.panes.center + , appendEl: that.Views.App.Layout.panes.center })); } @@ -347,6 +348,8 @@ console.log(Bootstrap); that._modalAbout = $(tmplModalAbout); that._modalAbout.on("hidden", function __fnEventAppModalAboutClosed(event) { + // FIXME: Doesn't seem to work + console.log(window.history.length, that.historyStart); if (window.history.length === that.historyStart) { that.navigate("", false); } else { diff --git a/resources/js/views/browser.js b/resources/js/views/browser.js index ca10c21..8119552 100644 --- a/resources/js/views/browser.js +++ b/resources/js/views/browser.js @@ -43,7 +43,6 @@ _ ; Browser.__super__.initialize.apply(that); - that.client = client; } }); diff --git a/resources/js/views/client.js b/resources/js/views/client.js index 53c5fc6..10256cd 100644 --- a/resources/js/views/client.js +++ b/resources/js/views/client.js @@ -32,7 +32,8 @@ _ var Client = Backbone.View.extend({ id: null - , el: $(tmplClientLayout) + //, el: $(tmplClientLayout) + , tagName: "div" , Server: null @@ -61,10 +62,8 @@ _ that.el.id = "__view-cient-" + that.Server.client.attributes.hostname.replace(".", "_"); that.id = that.Server.client.attributes.hostname; - -/* - -*/ + that.el.innerHTML = tmplClientLayout; + that.el.innerHTML = that.el.innerHTML.replace("this.type", that.Server.client.url()); } , _initLayout: function () { diff --git a/resources/js/views/main.js b/resources/js/views/main.js index 0b77aee..8c4dbad 100644 --- a/resources/js/views/main.js +++ b/resources/js/views/main.js @@ -71,18 +71,15 @@ _ console.debug("Show view: "+ name);//, that.$el, that.children[name], that.children[name].$el); if (that.children[name] && that.children[name].$el) { + console.log(that.$el.find(that.children[name].$el)); if (that.$el.find(that.children[name].$el).length === 0) { that.$el.append(that.children[name].$el); } if (that.children[name].show) { - setTimeout(function __fnTimeoutMainViewShow() { - that.children[name].show(); - }, 50); + that.children[name].show(); } else { - setTimeout(function __fnTimeoutMainViewShow() { - that.children[name].$el.show(); - }, 50); + that.children[name].$el.show(); } } } @@ -102,7 +99,7 @@ _ } setTimeout(function __fnTimeoutMainViewHide() { - that.$el.find(that.children[name].$el).remove(); + that.$el.find(that.children[name].$el).detach(); }, 50); } } diff --git a/resources/js/views/sidebar.js b/resources/js/views/sidebar.js index d2dfc70..7e3be2b 100644 --- a/resources/js/views/sidebar.js +++ b/resources/js/views/sidebar.js @@ -200,6 +200,8 @@ console.log(event); model.destroy(); }, 10); } + + event.preventDefault(); }; }(item)); diff --git a/resources/templates/app/modal-login.html b/resources/templates/app/modal-login.html index 844cc32..522e6bd 100644 --- a/resources/templates/app/modal-login.html +++ b/resources/templates/app/modal-login.html @@ -4,19 +4,19 @@
{{dmap_itemname}} login

- +

- +

\ No newline at end of file diff --git a/resources/templates/client/layout.html b/resources/templates/client/layout.html index b9d5c86..dc6b89e 100644 --- a/resources/templates/client/layout.html +++ b/resources/templates/client/layout.html @@ -1,14 +1,12 @@ -
-
-
-

" + this.type + "

-
-
-

" + this.type + "

-
-
-

" + this.type + "

-
+
+
+

" + this.type + "

-
-
\ No newline at end of file +
+

" + this.type + "

+
+
+

" + this.type + "

+
+
+
\ No newline at end of file