From atreyee at linux.vnet.ibm.com Tue Aug 11 03:02:53 2015 Content-Type: multipart/mixed; boundary="===============6661782949142283163==" MIME-Version: 1.0 From: Atreye Mukhopadhyay To: kimchi-devel at ovirt.org Subject: Re: [Kimchi-devel] [PATCH 1/1] Fix :704 -page refreshing issue for wok branch Date: Tue, 11 Aug 2015 12:31:43 +0530 Message-ID: <55C99DD7.2070603@linux.vnet.ibm.com> In-Reply-To: 1438766322-12162-1-git-send-email-atreyee@linux.vnet.ibm.com --===============6661782949142283163== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, Could you please let me know your feedback regarding the below fix. On 8/5/2015 2:48 PM, Atreyee wrote: > 'undefined' value displayed in url and page was getting refreshed after l= ogged into wok page > > Signed-off-by: Atreyee > --- > 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/mess= age.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 =3D function() { > var defaultTab =3D tabs[0] > > var defaultTabPath =3D defaultTab && defaultTab['path'] > + > + //redirect to empty page when no plugin installed > + if(tabs.length=3D=3D=3D0){ > + DEFAULT_HASH =3D 'wok-empty'; > + }else{ > // Remove file extension from 'defaultTabPath' > DEFAULT_HASH =3D defaultTabPath && > defaultTabPath.substring(0, defaultTabPath.lastIndexOf(= '.')) > - > + } > $('#nav-menu').append(genTabs(tabs)); > > callback && callback(); > @@ -136,11 +141,16 @@ wok.main =3D function() { > * and clear location.hash to jump to home page. > */ > var tab =3D $('#nav-menu a[href=3D"' + url + '"]'); > - if (tab.length =3D=3D=3D 0) { > + if (tab.length =3D=3D=3D 0 && url!=3D'wok-empty.html') { > location.hash =3D ''; > return; > } > > + //Remove the tab arrow indicator for no plugin > + if(url=3D=3D'wok-empty.html'){ > + $('.menu-arrow').hide(); > + $('#main').html('No plugins installed currently.You can downlo= ad the available plugins Kimchi and Ging= er from Github').addClass('noPluginMessage'); > + }else{ > // Animate arrow indicator. > var left =3D $(tab).parent().position().left; > var width =3D $(tab).parent().width(); > @@ -163,6 +173,7 @@ wok.main =3D function() { > } > // Load page content. > loadPage(url); > + } > }; > > /** --===============6661782949142283163==--