Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
forEachArr(collisionGroups.slice(0).reverse(), function(group) {
if (~util.inArray(util.stamp(previous.valueOf()), group)) {
// If you find a previous schedule that overlaps, include it in the Collision Group to which it belongs.
group.push(util.stamp(schedule.valueOf()));
return false; // returning false can stop this loop
}
return true;
});
this.goingDuration = 0;
/**
* travelTime: coming-Duration minutes
* @type {number}
*/
this.comingDuration = 0;
/**
* Separate data storage space independent of rendering.
* @type {object}
*/
this.raw = null;
// initialize model id
util.stamp(this);
}
it('updateSchedule() can update Schedule model', function() {
var schedule = jasmine.createSpyObj('Schedule', ['set', 'cid', 'dirty']);
var id = util.stamp(schedule);
var calendarId = schedule.calendarId;
schedule.id = id;
schedule.cid.and.returnValue(id);
controller.schedules.add(schedule);
spyOn(controller, 'updateSchedule');
inst.updateSchedule(id, calendarId, {'hello': 'world'});
expect(controller.updateSchedule).toHaveBeenCalledWith(schedule, {'hello': 'world'});
expect(inst.render).toHaveBeenCalled();
});
it('can return the HTMLElement by schedule id and calendar id', function() {
var schedule = jasmine.createSpyObj('Schedule', ['set', 'cid', 'dirty']);
var id = util.stamp(schedule);
var calendarId = schedule.calendarId;
schedule.id = id;
schedule.cid.and.returnValue(id);
inst._controller.schedules.add(schedule);
spyOn(document, 'querySelector').and.callThrough();
inst.getElement(id, calendarId);
expect(document.querySelector).toHaveBeenCalled();
});
});
it('Can remove child view.', function() {
view.removeChild(util.stamp(view2));
expect(view.children.length).toBe(0);
});
it('"undo()" should restore the removed object', done => {
canvas.setActiveObject(object);
invoker.execute(commands.REMOVE_OBJECT, graphics, snippet.stamp(object)).then(() => (
invoker.undo()
)).then(() => {
expect(canvas.contains(object)).toBe(true);
done();
});
});
it('deleteSchedule() can delete Schedule model in collection.', function() {
var schedule = jasmine.createSpyObj('Schedule', ['set', 'cid', 'dirty']);
var id = util.stamp(schedule);
var calendarId = schedule.calendarId;
schedule.id = id;
schedule.cid.and.returnValue(id);
controller.schedules.add(schedule);
expect(controller.schedules.length).toBe(1);
inst.deleteSchedule(id, calendarId);
expect(controller.schedules.length).toBe(0);
});
});
collection = new Collection(function(model) {
return util.stamp(model);
});
collection.add.apply(collection, scheduleList);
*/
this._openers = [];
/**
* State of picker enable
* @type {boolean}
* @private
*/
this._isEnabled = true;
/**
* ID of instance
* @private
* @type {number}
*/
this._id = 'tui-datepicker-' + snippet.stamp(this);
/**
* DatePicker type
* @type {TYPE_DATE|TYPE_MONTH|TYPE_YEAR}
* @private
*/
this._type = options.type;
/**
* Show always or not
* @type {boolean}
*/
this.showAlways = options.showAlways;
/**
* Close after select a date
_off: function(obj, type, fn, context) {
var id = type + util.stamp(fn) + (context ? '_' + util.stamp(context) : ''),
handler = obj[eventKey] && obj[eventKey][id];
if (!handler) {
return;
}
if ('removeEventListener' in obj) {
if (type === 'mouseenter' || type === 'mouseleave') {
obj.removeEventListener((type === 'mouseenter') ?
'mouseover' : 'mouseout', handler, false);
} else {
if (type === 'mousewheel') {
obj.removeEventListener('DOMMouseScroll', handler, false);
}
obj.removeEventListener(type, handler, false);