Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Fix offcanvas links issue
Browse files Browse the repository at this point in the history
  • Loading branch information
imperavi authored and imperavi committed Feb 2, 2017
1 parent c738a21 commit bc88d08
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 30 deletions.
10 changes: 6 additions & 4 deletions dist/css/kube.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Kube. CSS & JS Framework
Version 6.5.1
Updated: January 27, 2017
Version 6.5.2
Updated: February 2, 2017
http://imperavi.com/kube/
Expand Down Expand Up @@ -878,8 +878,7 @@ label {
display: inline-block;
margin-right: 16px; }

.req,
.required {
.req {
position: relative;
top: 1px;
font-weight: bold;
Expand Down Expand Up @@ -993,6 +992,9 @@ button,
top: 1px;
margin: 0 2px; }

input[type="submit"] {
width: auto; }

button:hover,
.button:hover {
outline: none;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/kube.min.css

Large diffs are not rendered by default.

25 changes: 15 additions & 10 deletions dist/js/kube.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Kube. CSS & JS Framework
Version 6.5.1
Updated: January 27, 2017
Version 6.5.2
Updated: February 2, 2017
http://imperavi.com/kube/
Expand Down Expand Up @@ -304,7 +304,7 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
return this.makeSimpleEffects();
}

this.$element.addClass('kube-animated');
this.$element.addClass('kubeanimated');
this.$element.addClass(this.queue[0]);
this.removeHideClass();

Expand Down Expand Up @@ -345,7 +345,7 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
},
clean: function()
{
this.$element.removeClass('kube-animated').removeClass(this.queue[0]);
this.$element.removeClass('kubeanimated').removeClass(this.queue[0]);
}
};

Expand Down Expand Up @@ -944,6 +944,7 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};

this.$close = this.getCloseLink();
this.$element.on(this.opts.toggleEvent + '.' + this.namespace, $.proxy(this.toggle, this));
this.$target.addClass('offcanvas');
},
stop: function()
{
Expand Down Expand Up @@ -983,8 +984,8 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
this.closeAll();
this.callback('open');

this.$target.addClass('offcanvas-' + this.opts.direction);
this.$target.css('width', this.opts.width);
this.$target.addClass('offcanvas offcanvas-' + this.opts.direction);

this.pushBody();

Expand All @@ -1003,7 +1004,7 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
if ($el.hasClass('open'))
{
$el.css('width', '').animation('hide');
$el.removeClass('open offcanvas offcanvas-left offcanvas-right');
$el.removeClass('open offcanvas-left offcanvas-right');
}

});
Expand All @@ -1016,10 +1017,14 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
{
if (e)
{
e.preventDefault();

var $el = $(e.target);
if ($el.closest('.offcanvas').length !== 0 && !$el.hasClass('close')) return;
var isTag = ($el[0].tagName === 'A' || $el[0].tagName === 'BUTTON');
if (isTag && $el.closest('.offcanvas').length !== 0 && !$el.hasClass('close'))
{
return;
}

e.preventDefault();
}

if (this.isOpened())
Expand Down Expand Up @@ -1050,7 +1055,7 @@ if (typeof jQuery === 'undefined') {throw new Error('Kube\'s requires jQuery')};
{
if (this.detect.isMobileScreen()) $('html').removeClass('no-scroll');

this.$target.css('width', '').removeClass('offcanvas offcanvas-' + this.opts.direction);
this.$target.css('width', '').removeClass('offcanvas-' + this.opts.direction);

this.$close.off('.' + this.namespace);
$(document).off('.' + this.namespace);
Expand Down
2 changes: 1 addition & 1 deletion dist/js/kube.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/_js/Core/Kube.Animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
return this.makeSimpleEffects();
}

this.$element.addClass('kube-animated');
this.$element.addClass('kubeanimated');
this.$element.addClass(this.queue[0]);
this.removeHideClass();

Expand Down Expand Up @@ -123,7 +123,7 @@
},
clean: function()
{
this.$element.removeClass('kube-animated').removeClass(this.queue[0]);
this.$element.removeClass('kubeanimated').removeClass(this.queue[0]);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/_js/Core/Kube.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Kube. CSS & JS Framework
Version 6.5.1
Updated: January 27, 2017
Version 6.5.2
Updated: February 2, 2017
http://imperavi.com/kube/
Expand Down
17 changes: 11 additions & 6 deletions src/_js/Offcanvas/Kube.Offcanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

this.$close = this.getCloseLink();
this.$element.on(this.opts.toggleEvent + '.' + this.namespace, $.proxy(this.toggle, this));
this.$target.addClass('offcanvas');
},
stop: function()
{
Expand Down Expand Up @@ -81,8 +82,8 @@
this.closeAll();
this.callback('open');

this.$target.addClass('offcanvas-' + this.opts.direction);
this.$target.css('width', this.opts.width);
this.$target.addClass('offcanvas offcanvas-' + this.opts.direction);

this.pushBody();

Expand All @@ -101,7 +102,7 @@
if ($el.hasClass('open'))
{
$el.css('width', '').animation('hide');
$el.removeClass('open offcanvas offcanvas-left offcanvas-right');
$el.removeClass('open offcanvas-left offcanvas-right');
}

});
Expand All @@ -114,10 +115,14 @@
{
if (e)
{
e.preventDefault();

var $el = $(e.target);
if ($el.closest('.offcanvas').length !== 0 && !$el.hasClass('close')) return;
var isTag = ($el[0].tagName === 'A' || $el[0].tagName === 'BUTTON');
if (isTag && $el.closest('.offcanvas').length !== 0 && !$el.hasClass('close'))
{
return;
}

e.preventDefault();
}

if (this.isOpened())
Expand Down Expand Up @@ -148,7 +153,7 @@
{
if (this.detect.isMobileScreen()) $('html').removeClass('no-scroll');

this.$target.css('width', '').removeClass('offcanvas offcanvas-' + this.opts.direction);
this.$target.css('width', '').removeClass('offcanvas-' + this.opts.direction);

this.$close.off('.' + this.namespace);
$(document).off('.' + this.namespace);
Expand Down
3 changes: 3 additions & 0 deletions src/_scss/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ button,
margin: 0 2px;
}
}
input[type="submit"] {
width: auto;
}
button:hover,
.button:hover {
outline: none;
Expand Down
3 changes: 1 addition & 2 deletions src/_scss/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ label {
margin-right: 16px;
}
}
.req,
.required {
.req {
position: relative;
top: 1px;
font-weight: bold;
Expand Down
4 changes: 2 additions & 2 deletions src/kube.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Kube. CSS & JS Framework
Version 6.5.1
Updated: January 27, 2017
Version 6.5.2
Updated: February 2, 2017
http://imperavi.com/kube/
Expand Down

0 comments on commit bc88d08

Please sign in to comment.