Skip to content

Commit

Permalink
Merge branch 'release/2.24.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
saschadube committed Dec 18, 2015
2 parents 14bff18 + 87649e2 commit 8ae5e31
Show file tree
Hide file tree
Showing 19 changed files with 156 additions and 483 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

### 2.24.3 (December 18, 2015)

- Added support for using data-title attribute as lightbox caption
- Added mark first item in a row with ```uk-row-first``` when data-uk-grid-margin
- Added uk-slide-before uk-slide-after classes to slider element after item focus
- Added oncancel callback to UIkit.modal.confirm
- Updated allow params in data-uk-* attributes without curly braces
- Fixed .uk-display-inline-block with responsive child images (firefox)
- Fixed hash urls in Offcanvas
- Fixed slideshow scroll, swipe direction

### 2.24.2 (December 01, 2015)

- Fixed UIkit.Utils.stackMargin apply on container with only one child element
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uikit",
"version": "2.24.2",
"version": "2.24.3",
"homepage": "http://getuikit.com",
"main": [
"./dist/css/uikit.min.css",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "uikit/uikit",
"type": "library",
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
"version": "2.24.2",
"version": "2.24.3",
"keywords": [],
"homepage": "http://getuikit.com/",
"authors": [],
Expand Down
2 changes: 1 addition & 1 deletion docs/css/uikit.docs.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/js/uikit.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ <h3 class="tm-article-subtitle">Example</h3>

<pre><code>UIkit.modal.confirm("Are you sure?", function(){
// will be executed on confirm.
});</code></pre>
}[, oncanel, options]);</code></pre>

<button type="button" class="uk-button" onclick="UIkit.modal.prompt('Name:', '', function(val){ UIkit.modal.alert('Hello '+(val || 'Mr noname')+'!'); });">Prompt</button>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "uikit",
"title": "UIkit",
"description": "UIkit is a lightweight and modular front-end framework for developing fast and powerful web interfaces.",
"version": "2.24.2",
"version": "2.24.3",
"homepage": "http://www.getuikit.com",
"author": {
"name": "UIkit",
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/lightbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

siblings.push({
'source': ele.attr('href'),
'title' : ele.attr('title'),
'title' : ele.attr('data-title') || ele.attr('title'),
'type' : ele.attr("data-lightbox-type") || 'auto',
'link' : ele
});
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/parallax.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
h += extra;
w += Math.ceil(extra * ratio);

if (w > size.w && h < size.h) {
if (w-extra > size.w && h < size.h) {
return obj.element.css({'background-size': ''});
}

Expand Down
11 changes: 10 additions & 1 deletion src/js/components/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@

this.container.css({'min-width': pos, 'min-height': maxheight});

if (this.options.infinite && pos <= (2*this.vp) && !this.itemsResized) {
if (this.options.infinite && (pos <= (2*this.vp) || this.items.length < 5) && !this.itemsResized) {

// fill with cloned items
this.container.children().each(function(idx){
Expand Down Expand Up @@ -291,6 +291,15 @@
}
}

// mark elements
var left = this.items.eq(idx).data('left');

this.items.removeClass('uk-slide-before uk-slide-after').each(function(i){
if (i!==idx) {
UI.$(this).addClass(UI.$(this).data('left') < left ? 'uk-slide-before':'uk-slide-after');
}
});

this.focus = idx;

this.trigger('focusitem.uk.slider', [idx,this.items.eq(idx),this]);
Expand Down
18 changes: 9 additions & 9 deletions src/js/components/slideshow.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
var $this = this,
current = this.slides.eq(this.current),
next = this.slides.eq(index),
dir = direction ? direction : this.current < index ? -1 : 1,
dir = direction ? direction : this.current < index ? 1 : -1,
currentmedia = current.data('media'),
animation = Animations[this.options.animation] ? this.options.animation : 'fade',
nextmedia = next.data('media'),
Expand Down Expand Up @@ -443,14 +443,14 @@

next.css('opacity', 1).one(UI.support.animation.end, function() {

current.removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
current.removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
next.css('opacity', '').removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
d.resolve();

}.bind(this));

current.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
next.addClass(dir == 1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
current.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
next.addClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
next.width(); // force redraw

return d.promise();
Expand All @@ -465,14 +465,14 @@

next.css('opacity', 1).one(UI.support.animation.end, function() {

current.removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
next.css('opacity', '').removeClass(dir === 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
current.removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
next.css('opacity', '').removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
d.resolve();

}.bind(this));

current.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
next.addClass(dir == 1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
current.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
next.addClass(dir == -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
next.width(); // force redraw

return d.promise();
Expand Down
118 changes: 66 additions & 52 deletions src/js/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined;

UI.version = '2.24.2';
UI.version = '2.24.3';

UI.noConflict = function() {
// restore UIkit version
Expand Down Expand Up @@ -259,7 +259,11 @@

UI.Utils.options = function(string) {

if ($.isPlainObject(string)) return string;
if ($.type(string)!='string') return string;

if (string.indexOf(':') != -1 && string.trim().substr(-1) != '}') {
string = '{'+string+'}';
}

var start = (string ? string.indexOf("{") : -1), options = {};

Expand Down Expand Up @@ -617,86 +621,96 @@
if (UI.domready) UI.Utils.checkDisplay();
});

$(function(){
document.addEventListener('DOMContentLoaded', function(){

UI.$body = UI.$('body');
var domReady = function() {

UI.ready(function(context){
UI.domObserve('[data-uk-observe]');
});
UI.$body = UI.$('body');

UI.on('changed.uk.dom', function(e) {
UI.init(e.target);
UI.Utils.checkDisplay(e.target);
});
UI.ready(function(context){
UI.domObserve('[data-uk-observe]');
});

UI.trigger('beforeready.uk.dom');
UI.on('changed.uk.dom', function(e) {
UI.init(e.target);
UI.Utils.checkDisplay(e.target);
});

UI.component.bootComponents();
UI.trigger('beforeready.uk.dom');

// custom scroll observer
requestAnimationFrame((function(){
UI.component.bootComponents();

var memory = {x: window.pageXOffset, y:window.pageYOffset}, dir;
// custom scroll observer
requestAnimationFrame((function(){

var fn = function(){
var memory = {x: window.pageXOffset, y:window.pageYOffset}, dir;

if (memory.x != window.pageXOffset || memory.y != window.pageYOffset) {
var fn = function(){

dir = {x: 0 , y: 0};
if (memory.x != window.pageXOffset || memory.y != window.pageYOffset) {

if (window.pageXOffset != memory.x) dir.x = window.pageXOffset > memory.x ? 1:-1;
if (window.pageYOffset != memory.y) dir.y = window.pageYOffset > memory.y ? 1:-1;
dir = {x: 0 , y: 0};

memory = {
"dir": dir, "x": window.pageXOffset, "y": window.pageYOffset
};
if (window.pageXOffset != memory.x) dir.x = window.pageXOffset > memory.x ? 1:-1;
if (window.pageYOffset != memory.y) dir.y = window.pageYOffset > memory.y ? 1:-1;

UI.$doc.trigger('scrolling.uk.document', [memory]);
}
memory = {
"dir": dir, "x": window.pageXOffset, "y": window.pageYOffset
};

requestAnimationFrame(fn);
};
UI.$doc.trigger('scrolling.uk.document', [memory]);
}

if (UI.support.touch) {
UI.$html.on('touchmove touchend MSPointerMove MSPointerUp pointermove pointerup', fn);
}
requestAnimationFrame(fn);
};

if (memory.x || memory.y) fn();
if (UI.support.touch) {
UI.$html.on('touchmove touchend MSPointerMove MSPointerUp pointermove pointerup', fn);
}

if (memory.x || memory.y) fn();

return fn;
return fn;

})());
})());

// run component init functions on dom
UI.trigger('domready.uk.dom');
// run component init functions on dom
UI.trigger('domready.uk.dom');

if (UI.support.touch) {
if (UI.support.touch) {

// remove css hover rules for touch devices
// UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/);
// remove css hover rules for touch devices
// UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/);

// viewport unit fix for uk-height-viewport - should be fixed in iOS 8
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
// viewport unit fix for uk-height-viewport - should be fixed in iOS 8
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {

UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){
UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){

var fn = function() {
$('.uk-height-viewport').css('height', window.innerHeight);
return fn;
};
var fn = function() {
$('.uk-height-viewport').css('height', window.innerHeight);
return fn;
};

return fn();
return fn();

})(), 100));
})(), 100));
}
}

UI.trigger('afterready.uk.dom');

// mark that domready is left behind
UI.domready = true;
};

if (document.readyState == 'complete' || document.readyState == 'interactive') {
setTimeout(domReady);
}

UI.trigger('afterready.uk.dom');
return domReady;

// mark that domready is left behind
UI.domready = true;
});
}());

// add touch identifier class
UI.$html.addClass(UI.support.touch ? "uk-touch" : "uk-notouch");
Expand Down
3 changes: 2 additions & 1 deletion src/js/core/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
UI.component('gridMargin', {

defaults: {
"cls": "uk-grid-margin"
cls : 'uk-grid-margin',
rowfirst : 'uk-row-first'
},

boot: function() {
Expand Down
13 changes: 8 additions & 5 deletions src/js/core/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,18 +279,21 @@
return modal.show();
};

UI.modal.confirm = function(content, onconfirm, options) {
UI.modal.confirm = function(content, onconfirm, oncancel) {

var options = arguments.length > 1 && arguments[arguments.length-1] ? arguments[arguments.length-1] : {};

onconfirm = UI.$.isFunction(onconfirm) ? onconfirm : function(){};
options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
oncancel = UI.$.isFunction(oncancel) ? oncancel : function(){};
options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, UI.$.isFunction(options) ? {}:options);

var modal = UI.modal.dialog(([
'<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
'<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-confirm">'+options.labels.Ok+'</button></div>'
'<div class="uk-modal-footer uk-text-right"><button class="uk-button js-modal-confirm-cancel">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-confirm">'+options.labels.Ok+'</button></div>'
]).join(""), options);

modal.element.find(".js-modal-confirm").on("click", function(){
onconfirm();
modal.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click", function(){
UI.$(this).is('.js-modal-confirm') ? onconfirm() : oncancel();
modal.hide();
});

Expand Down
10 changes: 5 additions & 5 deletions src/js/core/offcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
Offcanvas.hide();
});

element.on("click", "a[href^='#']", function(e){
element.on("click", "a[href*='#']", function(e){

var link = UI.$(this),
href = link.attr("href");
Expand All @@ -111,16 +111,16 @@
var target;

try {
target = UI.$(href);
target = UI.$(link[0].hash);
} catch (e){
target = "";
target = '';
}

if (!target.length) {
target = UI.$('[name="'+href.replace('#','')+'"]');
target = UI.$('[name="'+link[0].hash.replace('#','')+'"]');
}

if (target.length && link.attr('data-uk-smooth-scroll') && UI.Utils.scrollToElement) {
if (target.length && UI.Utils.scrollToElement) {
UI.Utils.scrollToElement(target, UI.Utils.options(link.attr('data-uk-smooth-scroll') || '{}'));
} else {
window.location.href = href;
Expand Down
Loading

0 comments on commit 8ae5e31

Please sign in to comment.