Skip to content

Commit 6e524dc

Browse files
Removed viewportSize
1 parent 7bbf5dd commit 6e524dc

File tree

5 files changed

+7
-67
lines changed

5 files changed

+7
-67
lines changed

assets/js/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/source/app.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
$('[data-toggle="popover"]').popover();
2020

2121
var windowResize = function() {
22-
var $width = viewportSize.getWidth();
22+
var $width = document.documentElement.clientWidth;
2323

24-
console.log( $width );
25-
26-
if ( $width > 768 ) {
24+
if ( $width >= 768 ) {
2725
// @link http://wpeden.com/tipsntuts/twitter-bootstrap-dropdown-on-hover-and-activating-click-event-on-parent-item/
2826
$('.navbar .dropdown, .navbar .dropdown-submenu').hover(function() {
2927
$(this).find('.dropdown-menu').first().stop(true, true).delay(250).slideDown();

assets/js/vendor.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temp/js/app.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@
1919
$('[data-toggle="popover"]').popover();
2020

2121
var windowResize = function() {
22-
var $width = viewportSize.getWidth();
22+
var $width = document.documentElement.clientWidth;
2323

24-
console.log( $width );
25-
26-
if ( $width > 768 ) {
24+
if ( $width >= 768 ) {
2725
// @link http://wpeden.com/tipsntuts/twitter-bootstrap-dropdown-on-hover-and-activating-click-event-on-parent-item/
2826
$('.navbar .dropdown, .navbar .dropdown-submenu').hover(function() {
2927
$(this).find('.dropdown-menu').first().stop(true, true).delay(250).slideDown();

temp/js/vendor.js

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3769,62 +3769,6 @@ if (typeof jQuery === 'undefined') {
37693769

37703770
}(jQuery);
37713771

3772-
/*! viewportSize | Author: Tyson Matanich, 2013 | License: MIT */
3773-
(function (window) {
3774-
3775-
window.viewportSize = {};
3776-
3777-
window.viewportSize.getHeight = function () {
3778-
return getSize("Height");
3779-
};
3780-
3781-
window.viewportSize.getWidth = function () {
3782-
return getSize("Width");
3783-
};
3784-
3785-
var getSize = function (Name) {
3786-
var size;
3787-
var name = Name.toLowerCase();
3788-
var document = window.document;
3789-
var documentElement = document.documentElement;
3790-
if (window["inner" + Name] === undefined) {
3791-
// IE6 & IE7 don't have window.innerWidth or innerHeight
3792-
size = documentElement["client" + Name];
3793-
}
3794-
else if (window["inner" + Name] != documentElement["client" + Name]) {
3795-
// WebKit doesn't include scrollbars while calculating viewport size so we have to get fancy
3796-
3797-
// Insert markup to test if a media query will match document.doumentElement["client" + Name]
3798-
var bodyElement = document.createElement("body");
3799-
bodyElement.id = "vpw-test-b";
3800-
bodyElement.style.cssText = "overflow:scroll";
3801-
var divElement = document.createElement("div");
3802-
divElement.id = "vpw-test-d";
3803-
divElement.style.cssText = "position:absolute;top:-1000px";
3804-
// Getting specific on the CSS selector so it won't get overridden easily
3805-
divElement.innerHTML = "<style>@media(" + name + ":" + documentElement["client" + Name] + "px){body#vpw-test-b div#vpw-test-d{" + name + ":7px!important}}</style>";
3806-
bodyElement.appendChild(divElement);
3807-
documentElement.insertBefore(bodyElement, document.head);
3808-
3809-
if (divElement["offset" + Name] == 7) {
3810-
// Media query matches document.documentElement["client" + Name]
3811-
size = documentElement["client" + Name];
3812-
}
3813-
else {
3814-
// Media query didn't match, use window["inner" + Name]
3815-
size = window["inner" + Name];
3816-
}
3817-
// Cleanup
3818-
documentElement.removeChild(bodyElement);
3819-
}
3820-
else {
3821-
// Default to use window["inner" + Name]
3822-
size = window["inner" + Name];
3823-
}
3824-
return size;
3825-
};
3826-
3827-
})(this);
38283772
/*global jQuery */
38293773
/*jshint browser:true */
38303774
/*!

0 commit comments

Comments
 (0)