Skip to content

Commit

Permalink
iframe support
Browse files Browse the repository at this point in the history
  • Loading branch information
syastrebov committed Mar 16, 2017
1 parent b1d1e94 commit 6f3d7eb
Show file tree
Hide file tree
Showing 82 changed files with 142 additions and 155 deletions.
24 changes: 12 additions & 12 deletions dist/js/jquery.calendars.all.js
Original file line number Diff line number Diff line change
Expand Up @@ -1949,7 +1949,9 @@ $(selector).calendarsPicker({minDate: $.calendars.newDate(2001, 1, 1),
altFormat: null,
constrainInput: true,
commandsAsDateFormat: false,
commands: {} // this.commands
commands: {}, // this.commands
ownerDocument: document,
contentWindow: window
},

/** Localisations for the plugin.
Expand Down Expand Up @@ -2076,6 +2078,9 @@ $(selector).calendarsPicker({minDate: $.calendars.newDate(2001, 1, 1),
this.disable(elem[0]);
}
}

$(inst.options.ownerDocument).on('mousedown.' + pluginName, plugin._checkExternalClick).
on('resize.' + pluginName, function() { plugin.hide(plugin.curInst); });
},

_optionsChanged: function(elem, inst, options) {
Expand Down Expand Up @@ -2383,7 +2388,7 @@ $(selector).calendarsPicker({minDate: $.calendars.newDate(2001, 1, 1),
inst.div = $('<div></div>').addClass(this._popupClass).
css({display: (hidden ? 'none' : 'static'), position: 'absolute',
left: elem.offset().left, top: elem.offset().top + elem.outerHeight()}).
appendTo($(inst.options.popupContainer || 'body'));
appendTo($(inst.options.popupContainer || inst.options.ownerDocument.body));
if ($.fn.mousewheel) {
inst.div.mousewheel(this._doMouseWheel);
}
Expand Down Expand Up @@ -2450,8 +2455,8 @@ $(selector).calendarsPicker({minDate: $.calendars.newDate(2001, 1, 1),
_checkOffset: function(inst) {
var base = (inst.elem.is(':hidden') && inst.trigger ? inst.trigger : inst.elem);
var offset = base.offset();
var browserWidth = $(window).width();
var browserHeight = $(window).height();
var browserWidth = $(inst.options.contentWindow).width();
var browserHeight = $(inst.options.contentWindow).height();
if (browserWidth === 0) {
return offset;
}
Expand All @@ -2460,8 +2465,8 @@ $(selector).calendarsPicker({minDate: $.calendars.newDate(2001, 1, 1),
isFixed = isFixed || $(this).css('position') === 'fixed';
return !isFixed;
});
var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
var scrollX = inst.options.ownerDocument.documentElement.scrollLeft || inst.options.ownerDocument.body.scrollLeft;
var scrollY = inst.options.ownerDocument.documentElement.scrollTop || inst.options.ownerDocument.body.scrollTop;
var above = offset.top - (isFixed ? scrollY : 0) - inst.div.outerHeight();
var below = offset.top - (isFixed ? scrollY : 0) + base.outerHeight();
var alignL = offset.left - (isFixed ? scrollX : 0);
Expand Down Expand Up @@ -3118,7 +3123,7 @@ $(selector).datepick('setDate', [date1, date2, date3]) */
picker.addClass(inst.options.pickerClass);
}
// Resize
$('body').append(picker);
$(inst.options.ownerDocument.body).append(picker);
var width = 0;
picker.find(inst.options.renderer.monthSelector).each(function() {
width += $(this).outerWidth();
Expand Down Expand Up @@ -3387,9 +3392,4 @@ $(selector).datepick('setDate', [date1, date2, date3]) */

var plugin = $.calendarsPicker; // Singleton instance

$(function() {
$(document).on('mousedown.' + pluginName, plugin._checkExternalClick).
on('resize.' + pluginName, function() { plugin.hide(plugin.curInst); });
});

})(jQuery);
3 changes: 1 addition & 2 deletions dist/js/jquery.calendars.all.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/jquery.calendars.all.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/jquery.calendars.coptic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/jquery.calendars.coptic.min.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/js/jquery.calendars.discworld.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6f3d7eb

Please sign in to comment.