moksha/public
by John (J5) Palmieri
moksha/public/javascript/ui/moksha.ui.tabs.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 015112d057a426137bbf9f371831c327d0025553
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Fri Jul 2 13:22:22 2010 -0400
made work for IE
* It looks ugly but functionally IE seems to be on par with our main browsers
now
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js
index a05165b..e49b849 100644
--- a/moksha/public/javascript/ui/moksha.ui.tabs.js
+++ b/moksha/public/javascript/ui/moksha.ui.tabs.js
@@ -540,24 +540,24 @@ $.widget("ui.mokshatabs", $.ui.tabs, {
var offset = 0;
//remove the has because we only care about the / delimiter
- if (hash[0] == "#")
+ if (hash.charAt(0) == "#")
hash = hash.substr(1);
- hash = hash.split("/");
+ hash_items = hash.split("/");
// get the first id ignoring leading slashes
- for (var i=0; i<hash.length, !hash[i]; i++) {
+ for (var i=0; i<hash_items.length, !hash_items[i]; i++) {
offset++;
}
var id_index = level + offset;
- if (id_index >= hash.length)
+ if (id_index >= hash_items.length)
return -2;
- var id = "#" + hash[level + offset];
+ var id = "#" + hash_items[level + offset];
var remainder = level + offset + 1;
- if (this.options.passPathRemainder && hash.length > remainder)
- this.path_remainder = '/' + hash.splice(level + offset + 1).join('/');
+ if (this.options.passPathRemainder && hash_items.length > remainder)
+ this.path_remainder = '/' + hash_items.splice(level + offset + 1).join('/');
moksha.info('moksha.ui.tabs.js (hashToIndex): Selecting element ' + level + '(' + id + ') from hash "' + hash + '"');
return this.idToIndex(id);
13 years, 11 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/ui/moksha.ui.tabs.js | 34 ++++++++++++++++++++------
1 file changed, 27 insertions(+), 7 deletions(-)
New commits:
commit 9cac8dfe2a54fe0705e2cc8aa6016eb8813258dc
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Fri Jul 2 12:58:21 2010 -0400
Fix url update regression introduced during the JQuery.UI refactor
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js
index cb64a27..a05165b 100644
--- a/moksha/public/javascript/ui/moksha.ui.tabs.js
+++ b/moksha/public/javascript/ui/moksha.ui.tabs.js
@@ -120,15 +120,11 @@ $.widget("ui.mokshatabs", $.ui.tabs, {
// inline tab
if (fragmentId.test(href)) {
self.panels = self.panels.add(self._sanitizeSelector(href));
- } else if ($(a).hasClass('static_link') || o.staticLinkOnClick) {
- // static link on click assumes you have already validated
+ } else if ($(a).hasClass('static_link')) {
$.data(a, 'href.tabs', href);
$.data(a, 'load.tabs', href);
- if (!o.staticLinkOnClick) {
- a.href = moksha.url(href);
- }
-
+ a.href = moksha.url(href);
// remote tab
} else if (href != '#') { // prevent loading the page itself if href is just "#"
if (first_non_static_tab == -1)
@@ -401,7 +397,31 @@ $.widget("ui.mokshatabs", $.ui.tabs, {
o.selected = self.anchors.index(this);
- self.abort();
+ var $el = $(this)
+
+ // we don't get the actual href but the dynamic one
+ var href = $el.data('dynamic_href.tabs');
+
+ href = self._stripUUID(href);
+
+ //only update the hash level we care about
+ if (o.container_level != 0) {
+ var hash = self._generateTabLink(href.substr(1), false);
+
+ if (o.staticLoadOnClick) {
+ moksha.goto(hash);
+ return false;
+ } else {
+ location.hash = '#' + hash;
+ }
+ } else {
+ if (o.staticLoadOnClick) {
+ moksha.goto('/' + href.substr(1));
+ return false;
+ } else {
+ location.hash = href;
+ }
+ }
// if tab may be closed
if (o.collapsible) {
13 years, 11 months
moksha/public
by John (J5) Palmieri
moksha/public/javascript/moksha.extensions.js | 7 +++++--
moksha/public/javascript/ui/moksha.ui.popup.js | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit bcddee6c5016ed66af6e03233901996ffb52436c
Author: John (J5) Palmieri <johnp(a)redhat.com>
Date: Thu Jul 1 15:47:49 2010 -0400
fix some IE issues - use divs for extention points instead of custom tags
* we were using <moksha_extpoint> tags to denote extention points
but this does not work in IE. Namespacing as moksha:extpoint worked
but was inconsistant between browsers
* we now use <div class="moksha_extpoint"> as it works in all browsers
diff --git a/moksha/public/javascript/moksha.extensions.js b/moksha/public/javascript/moksha.extensions.js
index f805913..622dc7f 100644
--- a/moksha/public/javascript/moksha.extensions.js
+++ b/moksha/public/javascript/moksha.extensions.js
@@ -30,12 +30,15 @@ _extensions.prototype = {
},
grep_extensions: function(frag)
{
- var extension_points = jQuery('moksha_extpoint', frag);
+ // FIXME: I would like to use namespaces and custom tags but
+ // IE makes this dificult (and JQuery doesn't fully support it
+ // so use div with a class instead
+ var extension_points = jQuery('div.moksha_extpoint', frag);
extension_points.each
(
function(i)
{
- var ep = $(this)
+ var ep = $(this);
var data = ep.text();
//remove the extension point
ep.replaceWith('');
diff --git a/moksha/public/javascript/ui/moksha.ui.popup.js b/moksha/public/javascript/ui/moksha.ui.popup.js
index 117b74e..a3e8038 100644
--- a/moksha/public/javascript/ui/moksha.ui.popup.js
+++ b/moksha/public/javascript/ui/moksha.ui.popup.js
@@ -35,7 +35,7 @@ $.widget("ui.moksha_popup", {
panelClass: 'ui-moksha-popup-panel',
hoverTimeout: 500,
triggerEvent: 'hover',
- fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
+ fx: null // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
},
_create: function() {
13 years, 11 months