Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 244b3c2

Browse files
committed
fix(dependencies): fixed error handling for dependencies
1 parent 5468132 commit 244b3c2

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

dist/jquery.gridstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports['default'] = {
3030
EVENT_CELL_RESIZE: 'cellresize',
3131
EVENT_CELL_DRAG: 'celldrag',
3232
EVENT_CELL_REDRAW: 'cellredraw',
33-
ERROR_MISSING_JQUERY: 'Requires jQuery v?', //TODO
33+
ERROR_MISSING_JQUERY: 'Requires jQuery v3.2.1',
3434
ERROR_INVALID_ATTACH_ELEMENT: 'Cannot attach element that is not a child of gridstrap parent.',
3535
ERROR_NONCONTIGUOUS_HTML_UNDEFINED: 'nonContiguousCellHtml option cannot be null.'
3636
};
@@ -58,7 +58,7 @@ var _methods = require('./methods');
5858
(function ($, window, document) {
5959
$.Gridstrap = function (el, options) {
6060

61-
if (typeof jQuery == 'undefined') {
61+
if (typeof jQuery == 'undefined' || !jQuery.Event || !jQuery.Event.prototype.hasOwnProperty('changedTouches')) {
6262
throw new Error(_constants2['default'].ERROR_MISSING_JQUERY);
6363
}
6464

dist/jquery.gridstrap.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.

dist/jquery.gridstrap.min.js.map

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

docs/jquery.gridstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports['default'] = {
3030
EVENT_CELL_RESIZE: 'cellresize',
3131
EVENT_CELL_DRAG: 'celldrag',
3232
EVENT_CELL_REDRAW: 'cellredraw',
33-
ERROR_MISSING_JQUERY: 'Requires jQuery v?', //TODO
33+
ERROR_MISSING_JQUERY: 'Requires jQuery v3.2.1',
3434
ERROR_INVALID_ATTACH_ELEMENT: 'Cannot attach element that is not a child of gridstrap parent.',
3535
ERROR_NONCONTIGUOUS_HTML_UNDEFINED: 'nonContiguousCellHtml option cannot be null.'
3636
};
@@ -58,7 +58,7 @@ var _methods = require('./methods');
5858
(function ($, window, document) {
5959
$.Gridstrap = function (el, options) {
6060

61-
if (typeof jQuery == 'undefined') {
61+
if (typeof jQuery == 'undefined' || !jQuery.Event || !jQuery.Event.prototype.hasOwnProperty('changedTouches')) {
6262
throw new Error(_constants2['default'].ERROR_MISSING_JQUERY);
6363
}
6464

src/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
EVENT_CELL_RESIZE : 'cellresize',
1818
EVENT_CELL_DRAG: 'celldrag',
1919
EVENT_CELL_REDRAW: 'cellredraw',
20-
ERROR_MISSING_JQUERY: 'Requires jQuery v?', //TODO
20+
ERROR_MISSING_JQUERY: 'Requires jQuery v3.2.1',
2121
ERROR_INVALID_ATTACH_ELEMENT : 'Cannot attach element that is not a child of gridstrap parent.',
2222
ERROR_NONCONTIGUOUS_HTML_UNDEFINED : 'nonContiguousCellHtml option cannot be null.'
2323
};

src/gridstrap.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import {Methods} from './methods';
88
(function ($, window, document) {
99
$.Gridstrap = function (el, options) {
1010

11-
if (typeof(jQuery) == 'undefined'){
11+
if (
12+
typeof(jQuery) == 'undefined' ||
13+
!jQuery.Event ||
14+
!jQuery.Event.prototype.hasOwnProperty('changedTouches')){
1215
throw new Error(Constants.ERROR_MISSING_JQUERY);
1316
}
1417

test/compiled/jquery.gridstrap.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ exports['default'] = {
2121
EVENT_CELL_RESIZE: 'cellresize',
2222
EVENT_CELL_DRAG: 'celldrag',
2323
EVENT_CELL_REDRAW: 'cellredraw',
24-
ERROR_MISSING_JQUERY: 'Requires jQuery v?', //TODO
24+
ERROR_MISSING_JQUERY: 'Requires jQuery v3.2.1',
2525
ERROR_INVALID_ATTACH_ELEMENT: 'Cannot attach element that is not a child of gridstrap parent.',
2626
ERROR_NONCONTIGUOUS_HTML_UNDEFINED: 'nonContiguousCellHtml option cannot be null.'
2727
};

0 commit comments

Comments
 (0)