[Kimchi-devel] [PATCH 1/1] Fix :704 -page refreshing issue for wok branch
Atreyee
atreyee at linux.vnet.ibm.com
Wed Aug 5 09:18:42 UTC 2015
'undefined' value displayed in url and page was getting refreshed after logged into wok page
Signed-off-by: Atreyee <atreyee at linux.vnet.ibm.com>
---
ui/css/theme-default/message.css | 10 ++++++++++
ui/js/src/wok.main.js | 15 +++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/ui/css/theme-default/message.css b/ui/css/theme-default/message.css
index 28c392b..7cce15b 100644
--- a/ui/css/theme-default/message.css
+++ b/ui/css/theme-default/message.css
@@ -133,3 +133,13 @@
border: 2px solid #444;
color: #444;
}
+
+.noPluginMessage{
+ font-size: 18px;
+ height: 48px;
+ line-height: 48px;
+ text-shadow: -1px -1px 1px #ccc, 1px 1px 1px #fff;
+ padding-left: 10px;
+ padding-top:10px;
+
+}
diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js
index f4c9940..0d9baec 100644
--- a/ui/js/src/wok.main.js
+++ b/ui/js/src/wok.main.js
@@ -102,10 +102,15 @@ wok.main = function() {
var defaultTab = tabs[0]
var defaultTabPath = defaultTab && defaultTab['path']
+
+ //redirect to empty page when no plugin installed
+ if(tabs.length===0){
+ DEFAULT_HASH = 'wok-empty';
+ }else{
// Remove file extension from 'defaultTabPath'
DEFAULT_HASH = defaultTabPath &&
defaultTabPath.substring(0, defaultTabPath.lastIndexOf('.'))
-
+ }
$('#nav-menu').append(genTabs(tabs));
callback && callback();
@@ -136,11 +141,16 @@ wok.main = function() {
* and clear location.hash to jump to home page.
*/
var tab = $('#nav-menu a[href="' + url + '"]');
- if (tab.length === 0) {
+ if (tab.length === 0 && url!='wok-empty.html') {
location.hash = '';
return;
}
+ //Remove the tab arrow indicator for no plugin
+ if(url=='wok-empty.html'){
+ $('.menu-arrow').hide();
+ $('#main').html('No plugins installed currently.You can download the available plugins <a href="https://github.com/kimchi-project/kimchi">Kimchi</a> and <a href="https://github.com/kimchi-project/ginger">Ginger</a> from Github').addClass('noPluginMessage');
+ }else{
// Animate arrow indicator.
var left = $(tab).parent().position().left;
var width = $(tab).parent().width();
@@ -163,6 +173,7 @@ wok.main = function() {
}
// Load page content.
loadPage(url);
+ }
};
/**
--
2.1.0
More information about the Kimchi-devel
mailing list