From 6742a91902d7c89aaf8305ba39e8900585e6564d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 11 Jun 2013 17:12:50 +0400 Subject: [PATCH] added window title update with image name... Signed-off-by: Alex A. Naanou --- ui/compatibility.js | 5 +++++ ui/data.js | 2 ++ ui/setup.js | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/ui/compatibility.js b/ui/compatibility.js index 1695b083..6f59755f 100755 --- a/ui/compatibility.js +++ b/ui/compatibility.js @@ -82,6 +82,11 @@ if(window.CEF_dumpJSON != null){ window.reload = function(){ gui.Window.get().reload() } + window.setWindowTitle = function(text){ + var title = text +' - '+ APP_NAME + gui.Window.get().title = title + $('.title-bar .title').text(title) + } // load UI stuff... $(function(){ diff --git a/ui/data.js b/ui/data.js index 812abc35..5d20e301 100755 --- a/ui/data.js +++ b/ui/data.js @@ -7,6 +7,8 @@ //var DEBUG = DEBUG != null ? DEBUG : true +var APP_NAME = 'ImageGrid.Viewer' + var DATA_ATTR = 'DATA' var LOAD_SCREENS = 6 diff --git a/ui/setup.js b/ui/setup.js index 84aeb96e..9d07b3d0 100755 --- a/ui/setup.js +++ b/ui/setup.js @@ -211,6 +211,10 @@ function setupDataBindings(viewer){ .on('focusingImage', function(evt, image){ image = $(image) DATA.current = getImageGID(image) + + if(window.setWindowTitle != null){ + setWindowTitle(IMAGES[getImageGID(image)].path.split('/').pop()) + } })