Skip to content

Commit 8886df8

Browse files
committed
feat(dependencies): Add readOnly option to dependencies plugin
Close angular-gantt#591
1 parent ac4fab9 commit 8886df8

10 files changed

+351
-142
lines changed

assets/angular-gantt-dependencies-plugin.js

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

assets/angular-gantt-plugins.js

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

demo/app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ <h4 class="panel-title">
284284
</gantt-draw-task>
285285
<gantt-overlap></gantt-overlap>
286286
<gantt-resize-sensor></gantt-resize-sensor>
287-
<gantt-dependencies enabled="options.dependencies"></gantt-dependencies>
287+
<gantt-dependencies enabled="options.dependencies" read-only="options.readOnly"></gantt-dependencies>
288288
</div>
289289
</div>
290290
<div class="panel-body">

demo/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ <h4 class="panel-title">
274274
</gantt-draw-task>
275275
<gantt-overlap></gantt-overlap>
276276
<gantt-resize-sensor></gantt-resize-sensor>
277-
<gantt-dependencies enabled="options.dependencies"></gantt-dependencies>
277+
<gantt-dependencies enabled="options.dependencies" read-only="options.readOnly"></gantt-dependencies>
278278
</div>
279279
</div>
280280
<div class="panel-body">

demo/dist/scripts/oldieshim.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,13 @@ var min = Math.min;
6666
var to_string = ObjectPrototype.toString;
6767

6868
/* global Symbol */
69-
/* eslint-disable one-var-declaration-per-line */
69+
/* eslint-disable one-var-declaration-per-line, no-redeclare */
7070
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
71-
var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, tryFunctionObject = function tryFunctionObject(value) { try { fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]'; isCallable = function isCallable(value) { if (typeof value !== 'function') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };
71+
var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };
72+
7273
var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; };
7374
var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
74-
/* eslint-enable one-var-declaration-per-line */
75+
/* eslint-enable one-var-declaration-per-line, no-redeclare */
7576

7677
/* inlined from http://npmjs.com/define-properties */
7778
var supportsDescriptors = $Object.defineProperty && (function () {
@@ -1286,9 +1287,12 @@ var negativeYearString = '-000001';
12861287
var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1;
12871288
var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';
12881289

1290+
var getTime = call.bind(Date.prototype.getTime);
1291+
12891292
defineProperties(Date.prototype, {
12901293
toISOString: function toISOString() {
1291-
if (!isFinite(this)) {
1294+
if (!isFinite(this) || !isFinite(getTime(this))) {
1295+
// Adope Photoshop requires the second check.
12921296
throw new RangeError('Date.prototype.toISOString called on non-finite value.');
12931297
}
12941298

@@ -1414,7 +1418,7 @@ if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
14141418
length >= 4 ? new NativeDate(Y, M, D, h) :
14151419
length >= 3 ? new NativeDate(Y, M, D) :
14161420
length >= 2 ? new NativeDate(Y, M) :
1417-
length >= 1 ? new NativeDate(Y) :
1421+
length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) :
14181422
new NativeDate();
14191423
} else {
14201424
date = NativeDate.apply(this, arguments);

0 commit comments

Comments
 (0)