Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wet-boew/wet-boew
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentGoderre committed Jul 24, 2012
2 parents 8483a91 + 9f84f7a commit 76c86f8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion build/js/css/pe-ap-ie-min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/css/pe-ap-min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/pe-ap-min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/js/workers/lightbox.js
Expand Up @@ -73,16 +73,16 @@
$.extend(opts, overrides, elm.metadata());
}

// Add touchscreen support for launching the lightbox
$lb = elm.find('.lb-image, .lb-ajax, .lb-gallery, .lb-hidden-gallery, .lb-gallery-inline, .lb-hidden-gallery-inline').on('vclick', function () {
$.colorbox.launch(this);
});

// Build single images and AJAXed content
//elm.find('.lb-image, .lb-ajax').colorbox(opts);
$lb.filter('.lb-image, .lb-ajax').colorbox(opts);

// Build inline content
$inline = $lb.filter('.lb-inline'); //elm.find('.lb-inline');
$inline = $lb.filter('.lb-inline');
if ($inline.length > 0) {
opts2 = opts;
$.extend(opts2, {inline: "true"});
Expand All @@ -91,14 +91,14 @@

// Build galleries
opts2 = opts;
$lb.filter('.lb-gallery, .lb-hidden-gallery').each(function () { //elm.find('.lb-gallery, .lb-hidden-gallery').each(function () {
$lb.filter('.lb-gallery, .lb-hidden-gallery').each(function () {
$.extend(opts2, {rel: 'group' + (pe.fn.lightbox.groupindex += 1)});
$(this).find('a').colorbox(opts2);
});

// Build inline galleries
opts2 = opts;
$lb.filter('.lb-gallery-inline, .lb-hidden-gallery-inline').each(function () {//elm.find('.lb-gallery-inline, .lb-hidden-gallery-inline').each(function () {
$lb.filter('.lb-gallery-inline, .lb-hidden-gallery-inline').each(function () {
$.extend(opts2, {inline: 'true', rel: 'group' + (pe.fn.lightbox.groupindex += 1)});
$(this).find('a').colorbox(opts2);
});
Expand Down
23 changes: 16 additions & 7 deletions src/js/workers/slideout.js
Expand Up @@ -29,7 +29,16 @@
ttlHeight = 0,
wrapper,
keyhandler,
tocLinks;
tocLinks,
cssTest;

// Don't do anything if CSS is disabled
// Couldn't get _pe.cssenabled() to work
cssTest = $('<div style="display: none;">').appendTo('body');
if (cssTest.css('display') !== 'none') {
return;
}
cssTest.remove();

// Add the wrappers
wrapper = elm.wrap('<div id="slideoutWrapper" role="application" />').parent(); // This is used for overflow: hidden.
Expand All @@ -49,20 +58,20 @@
// Recalculate the slideout's position
reposition = function () {
if (!opened) { // Only when slideout is closed
var newPosition = $('#wb-main-in').offset().left;
var newPosition = $('#wb-core-in').offset().left;

if (newPosition <= borderWidth) {
newPosition = 0;
}

// Vertical
wrapper.css('top', $('#wb-main-in').offset().top);
wrapper.css('top', $('#wb-core-in').offset().top);
// Horizontal
wrapper.css('right', newPosition);
}
};

toggle = function (e) {
toggle = function () {
toggleLink.off('click vclick');
slideoutClose.off('click vclick');

Expand All @@ -71,7 +80,7 @@
if (pe.ie === 0 || document.documentMode !== undefined) {
wrapper.removeClass('slideoutWrapper')
.addClass('slideoutWrapperRel')
.css({"top": position.top - $('#wb-main-in').offset().top, "right": borderWidth - 10});
.css({"top": position.top - $('#wb-core-in').offset().top, "right": borderWidth - 10});
}
elm.show(); // Show the widget content if it is about to be opened
pe.focus(tocLinks.eq(0));
Expand All @@ -89,7 +98,7 @@
if (pe.ie === 0 || document.documentMode !== undefined) {
wrapper.addClass('slideoutWrapper');
wrapper.removeClass('slideoutWrapperRel');
wrapper.css('width', (imgShow.width + focusOutlineAllowance) + 'px').css('top', $('#wb-main-in').offset().top);
wrapper.css('width', (imgShow.width + focusOutlineAllowance) + 'px').css('top', $('#wb-core-in').offset().top);
reposition();
}
} else { // Slideout just opened
Expand Down Expand Up @@ -259,7 +268,7 @@
ttlHeight = elm.outerHeight();

// Set vertical position and hide the slideout on load -- we don't want it to animate so we can't call slideout.toggle()
wrapper.css('width', (imgShow.width + focusOutlineAllowance) + 'px').css('top', $('#wb-main-in').offset().top);
wrapper.css('width', (imgShow.width + focusOutlineAllowance) + 'px').css('top', $('#wb-core-in').offset().top);

// Hide widget content so we don't tab through the links when the slideout is closed
elm.hide().attr('aria-hidden', 'true');
Expand Down

0 comments on commit 76c86f8

Please sign in to comment.