Skip to content

Commit 8b0adf6

Browse files
committed
adds check for $.cookie if useCookie option set to true
1 parent bd786d7 commit 8b0adf6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

js/jquery.fn.gantt.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,16 @@
4848
scrollToToday: true
4949
};
5050

51+
/**
52+
* Extend options with default values
53+
*/
54+
if (options) {
55+
$.extend(settings, options);
56+
}
57+
58+
// can't use cookie if don't have `$.cookie`
59+
settings.useCookie = settings.useCookie && $.isFunction($.cookie);
60+
5161
// custom selector `:findday` used to match on specified day in ms.
5262
//
5363
// The selector is passed a date in ms and elements are added to the
@@ -1694,13 +1704,6 @@
16941704

16951705

16961706
this.each(function () {
1697-
/**
1698-
* Extend options with default values
1699-
*/
1700-
if (options) {
1701-
$.extend(settings, options);
1702-
}
1703-
17041707
this.data = null; // Received data
17051708
this.pageNum = 0; // Current page number
17061709
this.pageCount = 0; // Available pages count

0 commit comments

Comments
 (0)