Commit 029ea76d authored by Lanny Heidbreder's avatar Lanny Heidbreder Committed by frjo
Browse files

Issue #2223247 by drupalninja99, 75th Trombone: Add mobile detection to...

Issue #2223247 by drupalninja99, 75th Trombone: Add mobile detection to colorbox-load and colorbox-inline
parent d7a4de76
......@@ -5,6 +5,15 @@ Drupal.behaviors.initColorboxInline = {
if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
return;
}
if (settings.colorbox.mobiledetect && window.matchMedia) {
// Disable Colorbox for small screens.
var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
if (mq.matches) {
return;
}
}
$.urlParam = function(name, url){
if (name == 'fragment') {
var results = new RegExp('(#[^&#]*)').exec(url);
......
......@@ -5,6 +5,15 @@ Drupal.behaviors.initColorboxLoad = {
if (!$.isFunction($.colorbox) || typeof settings.colorbox === 'undefined') {
return;
}
if (settings.colorbox.mobiledetect && window.matchMedia) {
// Disable Colorbox for small screens.
var mq = window.matchMedia("(max-device-width: " + settings.colorbox.mobiledevicewidth + ")");
if (mq.matches) {
return;
}
}
$.urlParams = function (url) {
var p = {},
e,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment