Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setData: function (state, options, dataset) {
// If no options specify by user, use default options
if (options != null) {
$.extend(this.options, options);
}
form.setValue(state);
return this;
},
function BaseModel (attrs) {
// attributes are applied directly
// onto the instance:
$.extend(this, attrs)
// register model with `store` of
// global notifications
// (after checking `modelName` property)
if (!this.modelName || typeof this.modelName !== 'string') {
throw new Error('cannot init model without `modelName` property')
} else {
this.store = store
this.store.register(this.modelName)
}
}
function ProjectNotifications(data) {
// Treebeard version
var tbOptions = $.extend({}, projectSettingsTreebeardBase.defaults, {
divID: 'grid',
filesData: data,
naturalScrollLimit : 0,
onload : function () {
var tb = this;
expandOnLoad.call(tb);
},
resolveRows: function notificationResolveRows(item){
var columns = [];
var iconcss = '';
// check if should not get icon
if(item.children.length < 1 ){
iconcss = 'tb-no-icon';
}
if (item.data.kind === 'heading') {
if (item.data.children.length === 0) {
// common extra options for all choice inputs
this.options.fieldChoiceOptions = {
select2: {
formatSelectionTemplate: $(this.options.select2FieldChoiceTemplate).text()
}
};
// options column's filed choice input
if (!this.options.columnFieldChoiceOptions) {
this.options.columnFieldChoiceOptions = {};
}
_.defaults(this.options.columnFieldChoiceOptions, this.options.fieldChoiceOptions);
// options for segment choice
this.options.segmentChoiceOptions = {};
$.extend(true, this.options.segmentChoiceOptions, this.options.fieldChoiceOptions, {
select2: {
formatSelectionTemplate: $(this.options.select2SegmentChoiceTemplate).text()
}
});
},
extend(extension) {
const init = extension.init;
this.extensions.push(extension);
$.extend(this, omit(extension, "init"));
if ($.isFunction(init)) {
init.apply(this);
}
}
};
constructor(element, options) {
this.element = element;
this.$element = $(element);
this.options = $.extend(true, {}, DEFAULTS, options, this.$element.data());
this.namespace = this.options.namespace;
this.classes = this.options.classes;
this.easing = EASING[this.options.easing] || EASING.ease;
this.$element.addClass(this.classes.element);
this.min = this.$element.attr('aria-valuemin');
this.max = this.$element.attr('aria-valuemax');
this.min = this.min ? parseInt(this.min, 10) : this.options.min;
this.max = this.max ? parseInt(this.max, 10) : this.options.max;
this.first = this.$element.attr('aria-valuenow');
this.first = this.first ? parseInt(this.first, 10) : (this.options.first ? this.options.first : this.min);
this.now = this.first;
this.goal = this.options.goal;
this._frameId = null;
_.each(['columns', 'sorter'], function(attr) {
if (_.isEmpty(item[attr])) {
$.extend(true, item, _.pick(initialState, attr));
}
});
});
template.on('click', '.detail-numbers .list-assigned-items .remove-number', function() {
var $this = $(this),
userName = $this.parents('.grid-row').find('.grid-cell.name').text(),
dataNumbers = $.extend(true, [], extensionsToSave),
userId = $this.parents('.grid-row').data('id'),
row = $this.parents('.item-row');
row.slideUp(function() {
row.remove();
if ( !template.find('.list-assigned-items .item-row').is(':visible') ) {
template.find('.list-assigned-items .empty-row').slideDown();
}
template.find('.item-row').each(function(idx, elem) {
dataNumbers.push($(elem).data('id'));
});
self.usersUpdateCallflowNumbers(userId, (currentCallflow || {}).id, dataNumbers, function(callflowData) {
toastr.success(monster.template(self, '!' + toastrMessages.numbersUpdated, { name: userName }));
constructor(colorpicker, options = {}) {
super(colorpicker, $.extend(true, {}, defaults, options));
if ((!Array.isArray(this.options.colors)) && (typeof this.options.colors !== 'object')) {
this.options.colors = null;
}
}
export const item = function (state = defaultItem, action) {
switch (action.type) {
case UPDATE_ITEM_APP_ITEM:
return $.extend(true,{},state,action.parameters);
case UPDATE_ITEM_APP_ITEM_TITLE:
return $.extend(true,{},state,{title: action.title});
case UPDATE_ITEM_APP_ITEM_SUBTITLE:
return $.extend(true,{},state,{snippet: action.subtitle});
case UPDATE_LAYOUT_ID:
let index = state.typeKeywords.length;
state.typeKeywords.forEach((current,i) => {
if (current.match('layout-')) {
index = i;
}
});
const typeKeywords = [
...state.typeKeywords.slice(0, index),
'layout-' + action.id,
...state.typeKeywords.slice(index + 1)
];
return $.extend(true,{},state,{typeKeywords});