From 72371b1ad271f81ee09e7eaf916941bef9a46d27 Mon Sep 17 00:00:00 2001 From: Darren Date: Tue, 2 Oct 2012 19:31:04 +0100 Subject: [PATCH] Server tab icons #52 #53 --- client_backbone/css/style.css | 3 ++- client_backbone/dev/model_panel.js | 4 ++++ client_backbone/dev/model_server.js | 3 +++ client_backbone/dev/view.js | 12 ++++++++++-- client_backbone/img/server_tab.png | Bin 0 -> 1151 bytes 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 client_backbone/img/server_tab.png diff --git a/client_backbone/css/style.css b/client_backbone/css/style.css index bc3e3ae..72aae7c 100644 --- a/client_backbone/css/style.css +++ b/client_backbone/css/style.css @@ -74,7 +74,8 @@ a { color:#36C; text-decoration:none; cursor:pointer; } #toolbar .panellist li img { width:1em; height:1em; top:7px; right:5px; position:absolute; } #toolbar .panellist li img.icon { left:5px; top:2px; height:auto; width:auto; } - +#toolbar .panellist li.server span { background:url(../img/server_tab.png) no-repeat; padding-left:23px; } +#toolbar .panellist li span { line-height:20px; vertical-align:middle; display:block; } #status_message { background: #FEEFB3; color: #9F6000; border-bottom: 1px solid; diff --git a/client_backbone/dev/model_panel.js b/client_backbone/dev/model_panel.js index ac123d4..e0fd88f 100755 --- a/client_backbone/dev/model_panel.js +++ b/client_backbone/dev/model_panel.js @@ -90,5 +90,9 @@ kiwi.model.Panel = Backbone.Model.extend({ isApplet: function () { return this.applet ? true : false; + }, + + isServer: function () { + return this.server ? true : false; } }); \ No newline at end of file diff --git a/client_backbone/dev/model_server.js b/client_backbone/dev/model_server.js index af5ee1d..eb64e14 100755 --- a/client_backbone/dev/model_server.js +++ b/client_backbone/dev/model_server.js @@ -1,4 +1,7 @@ kiwi.model.Server = kiwi.model.Panel.extend({ + // Used to determine if this is a server panel + server: true, + server_login: null, initialize: function (attributes) { diff --git a/client_backbone/dev/view.js b/client_backbone/dev/view.js index 0875285..1ee929b 100755 --- a/client_backbone/dev/view.js +++ b/client_backbone/dev/view.js @@ -459,7 +459,6 @@ kiwi.view.Tabs = Backbone.View.extend({ this.tabs_applets = $('ul.applets', this.$el); this.tabs_msg = $('ul.channels', this.$el); - window.t = this; kiwi.gateway.on('change:name', function (gateway, new_val) { $('span', this.model.server.tab).text(new_val); @@ -495,6 +494,11 @@ kiwi.view.Tabs = Backbone.View.extend({ panelAdded: function (panel) { // Add a tab to the panel panel.tab = $('
  • ' + (panel.get('title') || panel.get('name')) + '
  • '); + + if (panel.isServer()) { + panel.tab.addClass('server'); + } + panel.tab.data('panel_id', panel.cid) .appendTo(panel.isApplet() ? this.tabs_applets : this.tabs_msg); @@ -515,7 +519,11 @@ kiwi.view.Tabs = Backbone.View.extend({ this.tabs_msg.children().removeClass('active'); panel.tab.addClass('active'); - panel.tab.append(''); + + // Only show the part image on non-server tabs + if (!panel.isServer()) { + panel.tab.append(''); + } }, tabClick: function (e) { diff --git a/client_backbone/img/server_tab.png b/client_backbone/img/server_tab.png new file mode 100644 index 0000000000000000000000000000000000000000..19eb313e9d9d5a78b61c2a288383c02f24753e11 GIT binary patch literal 1151 zcmV-_1c3XAP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv000B-NklS|0R6x+7DGj zRZu#hfUgG*Ld)b8s2;8cw8QP1XZ}PVlSLq^x~ZO3?c8RUJuh~bh@b>o3TcjPF*Q*c zrb$LQUjSu86;Oci>z*c1dYaz2=IOurh*dAb&{WeVI`w?9s{~T*ng0NAaT1*di|Ix^ zBhPZK5Q^QUaCE2=E{@fMEz}Q~?#uqU-Zc_?&?rk_b_k^dhZYwT6{7J=yoCz2E{W6fqp`s#pN0Vz!SJCzZ|GG{)V8$An`CoVyorx}Fj z6JYh}3M3ntk!ft?aJA%WgLlEZxw=Me$@yWYr8V((;J z9<)5U4BgWzFwETpEcO7VxnG23arq~=+V(&eda+cQxEayiBpdRXZ8s<$9|n!k4&8!^ z)Y?lnZ0@6ddKvDfsibT2#=7d^lM5MaE=V2n6-y(BD}u&}2I!n_2kp~4fF00_Mf-sA z^?fA4o2}U3C+>MWn0i6E=kEL=<^INR3 z^>NM4hAf5H?3385wHiTHf7|=Rg39wfsHT)yoGqZndg`800~OE`!~K|^3_(}*vppM^ zJ=^R75Yjr|TyrSi(WAbhd%#rW2$=V-c+#%)k?|Wo#mL4!&ei|e^TGekeG6Xf1wKFC R%Gm$_002ovPDHLkV1ncJ7{~ws literal 0 HcmV?d00001 -- 2.25.1