diff --git a/bower.json b/bower.json
index 5d5ded7..a7b4ef6 100644
--- a/bower.json
+++ b/bower.json
@@ -1,7 +1,7 @@
{
"name": "kendo-pouchdb",
"main": "kendo-pouchdb.js",
- "version": "0.1.5",
+ "version": "0.1.6",
"description": "Kendo UI adapter for PouchDB",
"homepage": "https://github.com/terikon/kendo-pouchdb",
@@ -35,9 +35,9 @@
"dependencies": {
"jquery": "^2.1.4",
- "pouchdb": "^3.4.0",
+ "pouchdb": "^4.0.0",
"pouchdb-collate": "^1.2.0",
- "pouchdb-find": "^0.3.4"
+ "pouchdb-find": "^0.4.0"
},
"ignore": [
diff --git a/package.json b/package.json
index eb227ad..53a7bc1 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "kendo-pouchdb",
"title": "kendoPouchDB",
- "version": "0.1.5",
+ "version": "0.1.6",
"description": "Kendo UI adapter for PouchDB",
"main": "kendo-pouchdb.js",
"scripts": {
@@ -36,9 +36,9 @@
"dependencies": {
"jasmine-core": "^2.3.4",
"jquery": "^2.1.4",
- "pouchdb": "^3.4.0",
+ "pouchdb": "^4.0.0",
"pouchdb-collate": "^1.2.0",
- "pouchdb-find": "^0.3.4"
+ "pouchdb-find": "^0.4.0"
},
"devDependencies": {
"grunt": "^0.4.5",
@@ -47,6 +47,6 @@
"grunt-contrib-jasmine": "^0.9.0",
"underscore": "^1.8.3",
"grunt-kendo-lint": "~0.0.3",
- "load-grunt-tasks": "~3.2.0"
+ "load-grunt-tasks": "~3.3.0"
}
}
diff --git a/vendor/kendo/kendo.binder.js b/vendor/kendo/kendo.binder.js
index 88e6c89..b26dd54 100644
--- a/vendor/kendo/kendo.binder.js
+++ b/vendor/kendo/kendo.binder.js
@@ -21,32 +21,25 @@
/*jshint eqnull: true */
(function ($, undefined) {
var kendo = window.kendo,
- browser = kendo.support.browser,
Observable = kendo.Observable,
ObservableObject = kendo.data.ObservableObject,
ObservableArray = kendo.data.ObservableArray,
toString = {}.toString,
binders = {},
- slice = Array.prototype.slice,
Class = kendo.Class,
- innerText,
proxy = $.proxy,
VALUE = "value",
SOURCE = "source",
EVENTS = "events",
CHECKED = "checked",
+ CSS = "css",
deleteExpando = true,
+ FUNCTION = "function",
CHANGE = "change";
(function() {
var a = document.createElement("a");
- if (a.innerText !== undefined) {
- innerText = "innerText";
- } else if (a.textContent !== undefined) {
- innerText = "textContent";
- }
-
try {
delete a.test;
} catch(e) {
@@ -296,7 +289,7 @@
var TypedBinder = Binder.extend({
dataType: function() {
- var dataType = this.element.getAttribute("data-type") || this.element.type || "text";
+ var dataType = this.element.getAttribute("data-type") || this.element.type || "text";
return dataType.toLowerCase();
},
@@ -304,7 +297,7 @@
return this._parseValue(this.element.value, this.dataType());
},
- _parseValue : function (value, dataType){
+ _parseValue: function (value, dataType){
if (dataType == "date") {
value = kendo.parseDate(value, "yyyy-MM-dd");
} else if (dataType == "datetime-local") {
@@ -329,6 +322,23 @@
}
});
+ binders.css = Binder.extend({
+ init: function(element, bindings, options) {
+ Binder.fn.init.call(this, element, bindings, options);
+ this.classes = {};
+ },
+ refresh: function(className) {
+ var element = $(this.element),
+ binding = this.bindings.css[className],
+ hasClass = this.classes[className] = binding.get();
+ if(hasClass){
+ element.addClass(className);
+ }else{
+ element.removeClass(className);
+ }
+ }
+ });
+
binders.style = Binder.extend({
refresh: function(key) {
this.element.style[key] = this.bindings.style[key].get() || "";
@@ -398,12 +408,12 @@
binders.text = Binder.extend({
refresh: function() {
var text = this.bindings.text.get();
-
+ var dataFormat = this.element.getAttribute("data-format") || "";
if (text == null) {
text = "";
}
- this.element[innerText] = text;
+ $(this.element).text(kendo.toString(text, dataFormat));
}
});
@@ -543,7 +553,6 @@
} else {
template = "#:data#";
}
-
template = kendo.template(template);
}
@@ -577,7 +586,7 @@
for (idx = 0; idx < items.length; idx++) {
var child = element.children[index];
- unbindElementTree(child);
+ unbindElementTree(child, true);
element.removeChild(child);
}
},
@@ -599,7 +608,7 @@
}
if (this.bindings.template) {
- unbindElementChildren(element);
+ unbindElementChildren(element, true);
$(element).html(this.bindings.template.render(source));
@@ -692,6 +701,8 @@
}
if (element.value === value.toString()) {
element.checked = true;
+ }else{
+ element.checked = false;
}
}
},
@@ -713,6 +724,30 @@
};
binders.select = {
+ source: binders.source.extend({
+ refresh: function(e) {
+ var that = this,
+ source = that.bindings.source.get();
+
+ if (source instanceof ObservableArray || source instanceof kendo.data.DataSource) {
+ e = e || {};
+ if (e.action == "add") {
+ that.add(e.index, e.items);
+ } else if (e.action == "remove") {
+ that.remove(e.index, e.items);
+ } else if (e.action == "itemchange" || e.action === undefined) {
+ that.render();
+ if(that.bindings.value){
+ if (that.bindings.value) {
+ that.element.value = retrievePrimitiveValues(that.bindings.value.get(), $(that.element).data("valueField"));
+ }
+ }
+ }
+ } else {
+ that.render();
+ }
+ }
+ }),
value: TypedBinder.extend({
init: function(target, bindings, options) {
TypedBinder.fn.init.call(this, target, bindings, options);
@@ -755,7 +790,21 @@
idx,
length;
- values = this.parsedValue();
+ for (idx = 0, length = element.options.length; idx < length; idx++) {
+ option = element.options[idx];
+
+ if (option.selected) {
+ value = option.attributes.value;
+
+ if (value && value.specified) {
+ value = option.value;
+ } else {
+ value = option.text;
+ }
+
+ values.push(this._parseValue(value, this.dataType()));
+ }
+ }
if (field) {
source = this.bindings.source.get();
@@ -765,7 +814,8 @@
for (valueIndex = 0; valueIndex < values.length; valueIndex++) {
for (idx = 0, length = source.length; idx < length; idx++) {
- var match = valuePrimitive ? (this._parseValue(values[valueIndex], this.dataType()) === source[idx].get(field)) : (this._parseValue(source[idx].get(field), this.dataType()).toString() === values[valueIndex]);
+ var sourceValue = this._parseValue(source[idx].get(field), this.dataType());
+ var match = (String(sourceValue) === values[valueIndex]);
if (match) {
values[valueIndex] = source[idx];
break;
@@ -787,7 +837,6 @@
var optionIndex,
element = this.element,
options = element.options,
- valuePrimitive = this.options.valuePrimitive,
value = this.bindings[VALUE].get(),
values = value,
field = this.options.valueField || this.options.textField,
@@ -859,7 +908,7 @@
items = e.removedItems || widget.items();
for (idx = 0, length = items.length; idx < length; idx++) {
- unbindElementTree(items[idx]);
+ unbindElementTree(items[idx], false);
}
},
@@ -880,7 +929,13 @@
dataSource = widget[fieldName],
view,
parents,
- groups = dataSource.group() || [];
+ hds = kendo.data.HierarchicalDataSource;
+
+ if (hds && dataSource instanceof hds) {
+ // suppress binding of HDS items, because calling view() on root
+ // will return only root items, and widget.items() returns all items
+ return;
+ }
if (items.length) {
view = e.addedDataItems || dataSource.flatView();
@@ -895,7 +950,8 @@
refresh: function(e) {
var that = this,
source,
- widget = that.widget;
+ widget = that.widget,
+ select, multiselect;
e = e || {};
@@ -915,6 +971,13 @@
widget[setter](source._dataSource);
} else {
widget[fieldName].data(source);
+
+ select = kendo.ui.Select && widget instanceof kendo.ui.Select;
+ multiselect = kendo.ui.MultiSelect && widget instanceof kendo.ui.MultiSelect;
+
+ if (that.bindings.value && (select || multiselect)) {
+ widget.value(retrievePrimitiveValues(that.bindings.value.get(), widget.options.dataValueField));
+ }
}
}
}
@@ -1094,7 +1157,7 @@
value = null;
} else {
if (!source || source instanceof kendo.data.DataSource) {
- source = this.widget.dataSource.view();
+ source = this.widget.dataSource.flatView();
}
if (isArray) {
@@ -1136,28 +1199,45 @@
},
refresh: function() {
-
if (!this._initChange) {
- var field = this.options.dataValueField || this.options.dataTextField,
- value = this.bindings.value.get(),
- idx = 0, length,
- values = [];
+ var widget = this.widget;
+ var options = widget.options;
+ var textField = options.dataTextField;
+ var valueField = options.dataValueField || textField;
+ var value = this.bindings.value.get();
+ var text = options.text || "";
+ var idx = 0, length;
+ var values = [];
if (value === undefined) {
value = null;
}
- if (field) {
+ if (valueField) {
if (value instanceof ObservableArray) {
for (length = value.length; idx < length; idx++) {
- values[idx] = value[idx].get(field);
+ values[idx] = value[idx].get(valueField);
}
value = values;
} else if (value instanceof ObservableObject) {
- value = value.get(field);
+ text = value.get(textField);
+ value = value.get(valueField);
}
}
- this.widget.value(value);
+
+ if (options.autoBind === false && !options.cascadeFrom && widget.listView && !widget.listView.isBound()) {
+ if (textField === valueField && !text) {
+ text = value;
+ }
+
+ if (!text && (value || value === 0) && options.valuePrimitive) {
+ widget.value(value);
+ } else {
+ widget._preselect(value, text);
+ }
+ } else {
+ widget.value(value);
+ }
}
this._initChange = false;
@@ -1264,8 +1344,11 @@
refresh: function() {
if (!this._initChange) {
- var field = this.options.dataValueField || this.options.dataTextField,
+ var options = this.options,
+ widget = this.widget,
+ field = options.dataValueField || options.dataTextField,
value = this.bindings.value.get(),
+ data = value,
idx = 0, length,
values = [],
selectedValue;
@@ -1286,7 +1369,11 @@
}
}
- this.widget.value(value);
+ if (options.autoBind === false && options.valuePrimitive !== true && !widget.listView.isBound()) {
+ widget._preselect(data, value);
+ } else {
+ widget.value(value);
+ }
}
},
@@ -1381,6 +1468,7 @@
hasSource,
hasEvents,
hasChecked,
+ hasCss,
widgetBinding = this instanceof WidgetBindingTarget,
specificBinders = this.binders();
@@ -1393,6 +1481,8 @@
hasEvents = true;
} else if (key == CHECKED) {
hasChecked = true;
+ } else if (key == CSS) {
+ hasCss = true;
} else {
this.applyBinding(key, bindings, specificBinders);
}
@@ -1412,6 +1502,10 @@
if (hasEvents && !widgetBinding) {
this.applyBinding(EVENTS, bindings, specificBinders);
}
+
+ if (hasCss && !widgetBinding) {
+ this.applyBinding(CSS, bindings, specificBinders);
+ }
},
binders: function() {
@@ -1551,7 +1645,7 @@
parents = parents || [source];
if (role || bind) {
- unbindElement(element);
+ unbindElement(element, false);
}
if (role) {
@@ -1598,6 +1692,10 @@
bindings.events = createBindings(bind.events, parents, EventBinding);
}
+ if (bind.css) {
+ bindings.css = createBindings(bind.css, parents, Binding);
+ }
+
target.bind(bindings);
}
@@ -1634,7 +1732,7 @@
}
}
- function unbindElement(element) {
+ function unbindElement(element, destroyWidget) {
var bindingTarget = element.kendoBindingTarget;
if (bindingTarget) {
@@ -1648,20 +1746,27 @@
element.kendoBindingTarget = null;
}
}
+
+ if(destroyWidget) {
+ var widget = kendo.widgetInstance($(element));
+ if (widget && typeof widget.destroy === FUNCTION) {
+ widget.destroy();
+ }
+ }
}
- function unbindElementTree(element) {
- unbindElement(element);
+ function unbindElementTree(element, destroyWidgets) {
+ unbindElement(element, destroyWidgets);
- unbindElementChildren(element);
+ unbindElementChildren(element, destroyWidgets);
}
- function unbindElementChildren(element) {
+ function unbindElementChildren(element, destroyWidgets) {
var children = element.children;
if (children) {
for (var idx = 0, length = children.length; idx < length; idx++) {
- unbindElementTree(children[idx]);
+ unbindElementTree(children[idx], destroyWidgets);
}
}
}
@@ -1672,7 +1777,7 @@
dom = $(dom);
for (idx = 0, length = dom.length; idx < length; idx++ ) {
- unbindElementTree(dom[idx]);
+ unbindElementTree(dom[idx], false);
}
}
@@ -1685,6 +1790,29 @@
}
}
+ function retrievePrimitiveValues(value, valueField) {
+ var values = [];
+ var idx = 0;
+ var length;
+ var item;
+
+ if (!valueField) {
+ return value;
+ }
+
+ if (value instanceof ObservableArray) {
+ for (length = value.length; idx < length; idx++) {
+ item = value[idx];
+ values[idx] = item.get ? item.get(valueField) : item[valueField];
+ }
+ value = values;
+ } else if (value instanceof ObservableObject) {
+ value = value.get(valueField);
+ }
+
+ return value;
+ }
+
kendo.unbind = unbind;
kendo.bind = bind;
kendo.data.binders = binders;
diff --git a/vendor/kendo/kendo.calendar.js b/vendor/kendo/kendo.calendar.js
index 905f068..70ec604 100644
--- a/vendor/kendo/kendo.calendar.js
+++ b/vendor/kendo/kendo.calendar.js
@@ -878,11 +878,14 @@
adjustDST(today, 0);
today = +today;
+ start = new DATE(start.getFullYear(), start.getMonth(), start.getDate());
+ adjustDST(start, 0);
+
return view({
cells: 42,
perRow: 7,
html: html += '
',
- start: new DATE(start.getFullYear(), start.getMonth(), start.getDate()),
+ start: start,
min: new DATE(min.getFullYear(), min.getMonth(), min.getDate()),
max: new DATE(max.getFullYear(), max.getMonth(), max.getDate()),
content: options.content,
diff --git a/vendor/kendo/kendo.common.core.css b/vendor/kendo/kendo.common.core.css
index 03fe761..41d4c7b 100644
--- a/vendor/kendo/kendo.common.core.css
+++ b/vendor/kendo/kendo.common.core.css
@@ -128,15 +128,11 @@
.k-button.k-state-disabled:active {
cursor: default;
}
-.k-ie7 .k-button {
- line-height: normal;
-}
a.k-button {
- -khtml-user-select: none;
-webkit-user-select: none;
- -moz-user-select: -moz-none;
- -ms-user-select: none;
- user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
text-decoration: none;
}
/* Override the important default line-height in Firefox 4+ */
@@ -144,25 +140,6 @@ a.k-button {
padding-bottom: 0.37em;
padding-top: 0.37em;
}
-.k-ie7 .k-button {
- overflow: visible;
- margin-right: 4px;
-}
-.k-ie7 a.k-button {
- line-height: 1.6;
- padding-left: 7px;
- padding-right: 7px;
- /*+1*/
-}
-.k-ie7 .k-slider a.k-button {
- height: 22px;
- line-height: 22px;
- padding: 0;
-}
-.k-ie7 .k-button-expand {
- margin-left: 0;
- margin-right: 0;
-}
button.k-button::-moz-focus-inner,
input.k-button::-moz-focus-inner {
padding: 0;
@@ -182,11 +159,6 @@ body .k-split-button-arrow {
padding-left: .4em;
padding-right: .4em;
}
-.k-ie7 a.k-button-icon {
- padding-left: 5px;
- padding-right: 5px;
- /*+1*/
-}
.k-button-icontext {
overflow: visible;
/*IE9*/
@@ -278,10 +250,6 @@ html body .k-button-bare.k-upload-button:hover {
.k-sprite {
background-color: transparent;
}
-.k-ie7 .k-icon,
-.k-ie7 .k-sprite {
- text-indent: 0;
-}
.k-numerictextbox .k-select .k-link span.k-i-arrow-n {
background-position: 0 -3px;
}
@@ -1372,6 +1340,17 @@ html body .k-button-bare.k-upload-button:hover {
.k-button:active .k-i-more {
background-position: -80px -32px;
}
+.k-i-gantt-toggle {
+ background-position: -64px -240px;
+}
+.k-link:not(.k-state-disabled):hover > .k-i-gantt-toggle,
+.k-state-hover > .k-i-gantt-toggle,
+.k-state-hover > * > .k-i-gantt-toggle,
+.k-button:not(.k-state-disabled):hover .k-i-gantt-toggle,
+.k-textbox:hover .k-i-gantt-toggle,
+.k-button:active .k-i-gantt-toggle {
+ background-position: -80px -240px;
+}
.k-file > .k-icon {
background-position: -115px -91px;
}
@@ -1386,21 +1365,28 @@ html body .k-button-bare.k-upload-button:hover {
}
/* Dropdown icon in k-scheduler-views */
.k-pager-numbers .k-current-page .k-link:after,
-.k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after {
+.k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after,
+.k-gantt-views > .k-current-view > .k-link:after {
background-position: 0px -32px;
}
.k-link:not(.k-state-disabled):hover > .k-pager-numbers .k-current-page .k-link:after,
.k-link:not(.k-state-disabled):hover > .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after,
+.k-link:not(.k-state-disabled):hover > .k-gantt-views > .k-current-view > .k-link:after,
.k-state-hover > .k-pager-numbers .k-current-page .k-link:after,
.k-state-hover > .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after,
+.k-state-hover > .k-gantt-views > .k-current-view > .k-link:after,
.k-state-hover > * > .k-pager-numbers .k-current-page .k-link:after,
.k-state-hover > * > .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after,
+.k-state-hover > * > .k-gantt-views > .k-current-view > .k-link:after,
.k-button:not(.k-state-disabled):hover .k-pager-numbers .k-current-page .k-link:after,
.k-button:not(.k-state-disabled):hover .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after,
+.k-button:not(.k-state-disabled):hover .k-gantt-views > .k-current-view > .k-link:after,
.k-textbox:hover .k-pager-numbers .k-current-page .k-link:after,
.k-textbox:hover .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after,
+.k-textbox:hover .k-gantt-views > .k-current-view > .k-link:after,
.k-button:active .k-pager-numbers .k-current-page .k-link:after,
-.k-button:active .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after {
+.k-button:active .k-scheduler-toolbar > ul.k-scheduler-views > li.k-current-view .k-link:after,
+.k-button:active .k-gantt-views > .k-current-view > .k-link:after {
background-position: -16px -32px;
}
/* Colors */
@@ -1434,6 +1420,9 @@ html .k-error-colored {
.k-loading-text {
position: absolute;
}
+.k-loading-mask {
+ z-index: 100;
+}
.k-loading-text {
text-indent: -4000px;
text-align: center;
@@ -1546,8 +1535,7 @@ html .k-error-colored {
.k-block .k-header,
.k-list-container {
-webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
+ box-sizing: content-box;
}
.k-button,
.k-textbox,
@@ -1561,14 +1549,12 @@ div.k-window-content,
.km-actionsheet > li,
.km-shim {
-webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
+ box-sizing: border-box;
}
/* Fix for Bootstrap 3 */
.input-group .form-control {
-webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
+ box-sizing: border-box;
}
.form-control.k-widget {
padding: 0;
@@ -1577,9 +1563,8 @@ a.k-button:hover {
text-decoration: none;
}
/* override iOS styles in mobile Kendo */
-.k-widget,
-.k-widget * {
- -moz-background-clip: border-box;
+.km-widget,
+.km-widget * {
-webkit-background-clip: border-box;
background-clip: border-box;
}
@@ -1689,13 +1674,20 @@ input.k-checkbox,
}
input.k-checkbox + label {
-webkit-user-select: none;
- user-select: none;
}
/* Off-screen container used during export */
.k-pdf-export-shadow {
position: absolute;
- overflow: visible;
- left: -10000px;
+ overflow: hidden;
+ left: -15000px;
+ width: 14400px;
+}
+.km-native-scroller {
+ overflow: auto;
+ -webkit-overflow-scrolling: touch;
+ -ms-touch-action: pan-x pan-y;
+ -ms-overflow-style: -ms-autohiding-scrollbar;
+ -ms-scroll-snap-type: proximity;
}
/* responsive panel */
.k-rpanel-left {
@@ -1731,11 +1723,11 @@ input.k-checkbox + label {
}
.k-rpanel-top {
position: static;
- overflow: hidden;
max-height: 0;
}
.k-rpanel-top.k-rpanel-expanded {
max-height: 568px;
+ overflow: visible !important;
}
.k-edit-form {
margin: 0;
@@ -1847,13 +1839,6 @@ div.k-window-iframecontent {
.k-window-content > .km-scroll-container {
height: 100%;
}
-/* Compensate for content padding in IE7 */
-.k-ie7 .k-window {
- padding-bottom: 1.16em;
-}
-.k-ie7 .k-window-titleless {
- padding-bottom: 0;
-}
.k-window-titlebar .k-window-actions {
position: absolute;
top: 0;
@@ -1965,15 +1950,54 @@ div.k-window-iframecontent {
filter: alpha(opacity=0);
opacity: 0;
}
+.k-action-buttons {
+ clear: both;
+ text-align: right;
+ border-width: 1px 0 0;
+ border-style: solid;
+ position: relative;
+ bottom: -1em;
+ padding: .6em;
+ margin: 0 -1em;
+}
+.k-action-buttons .k-button {
+ display: inline-block;
+ margin: 0 0 0 6px;
+ min-width: 75px;
+}
/* TabStrip */
.k-tabstrip {
margin: 0;
padding: 0;
zoom: 1;
+ position: relative;
}
-.k-tabstrip .k-tabstrip-items {
+.k-tabstrip-items {
padding: 0.3em 0.3em 0;
}
+.k-tabstrip-scrollable .k-tabstrip-items {
+ white-space: nowrap;
+ overflow: hidden;
+}
+.k-tabstrip > .k-button {
+ position: absolute;
+ top: .4em;
+ z-index: 2;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+.k-tabstrip-bottom > .k-button {
+ top: auto;
+ bottom: .4em;
+}
+.k-tabstrip-prev {
+ left: .4em;
+}
+.k-tabstrip-next {
+ right: .4em;
+}
.k-tabstrip-items .k-item,
.k-panelbar .k-tabstrip-items .k-item {
list-style-type: none;
@@ -2012,11 +2036,6 @@ div.k-window-iframecontent {
margin: -3px 3px 0 -6px;
vertical-align: middle;
}
-.k-ie7 .k-tabstrip-items .k-item .k-image,
-.k-ie7 .k-tabstrip-items .k-item .k-sprite {
- margin-top: -1px;
- vertical-align: top;
-}
/* TabStrip Loading Progress */
.k-tabstrip-items .k-loading {
top: 0;
@@ -2028,28 +2047,20 @@ div.k-window-iframecontent {
border-top: 1px solid transparent;
border-color: inherit;
-webkit-transition: width 200ms linear;
- -moz-transition: width 200ms linear;
- -o-transition: width 200ms linear;
- transition: width 200ms linear;
+ transition: width 200ms linear;
-webkit-transition: "width 200ms linear";
- -moz-transition: "width 200ms linear";
- -ms-transition: "width 200ms linear";
- -o-transition: "width 200ms linear";
- transition: "width 200ms linear";
- animation: k-tab-loader 1s ease-in-out infinite;
- -moz-animation: k-tab-loader 1s ease-in-out infinite;
+ transition: "width 200ms linear";
-webkit-animation: k-tab-loader 1s ease-in-out infinite;
+ animation: k-tab-loader 1s ease-in-out infinite;
}
.k-tabstrip-items .k-progress {
- animation: none;
- -moz-animation: none;
-webkit-animation: none;
+ animation: none;
}
.k-tabstrip-items .k-loading.k-complete {
width: 100%;
- animation: none;
- -moz-animation: none;
-webkit-animation: none;
+ animation: none;
}
.k-tabstrip > .k-content,
.k-panelbar .k-tabstrip > .k-content {
@@ -2062,6 +2073,7 @@ div.k-window-iframecontent {
}
.k-tabstrip > .k-content {
display: none;
+ overflow: auto;
}
.k-tabstrip > .k-content.km-scroll-wrapper {
padding: 0;
@@ -2080,17 +2092,6 @@ div.k-window-iframecontent {
left: 0;
}
}
-@-moz-keyframes k-tab-loader {
- 0% {
- left: 0;
- }
- 50% {
- left: 80%;
- }
- 100% {
- left: 0;
- }
-}
@keyframes k-tab-loader {
0% {
left: 0;
@@ -2107,57 +2108,57 @@ div.k-window-iframecontent {
.k-tabstrip-right > div.k-content {
margin: .286em .3em;
}
-.k-tabstrip-left .k-tabstrip-items .k-item,
-.k-tabstrip-right .k-tabstrip-items .k-item {
+.k-tabstrip-left > .k-tabstrip-items .k-item,
+.k-tabstrip-right > .k-tabstrip-items .k-item {
display: block;
margin-bottom: -1px;
}
-.k-tabstrip-left .k-tabstrip-items .k-link,
-.k-tabstrip-right .k-tabstrip-items .k-link {
+.k-tabstrip-left > .k-tabstrip-items .k-link,
+.k-tabstrip-right > .k-tabstrip-items .k-link {
display: block;
}
-.k-tabstrip-left .k-tabstrip-items .k-tab-on-top,
-.k-tabstrip-right .k-tabstrip-items .k-tab-on-top,
-.k-tabstrip-left .k-tabstrip-items .k-state-active,
-.k-tabstrip-right .k-tabstrip-items .k-state-active,
-.k-tabstrip-left .k-panelbar .k-tabstrip-items .k-state-active,
-.k-tabstrip-right .k-panelbar .k-tabstrip-items .k-state-active {
+.k-tabstrip-left > .k-tabstrip-items .k-tab-on-top,
+.k-tabstrip-right > .k-tabstrip-items .k-tab-on-top,
+.k-tabstrip-left > .k-tabstrip-items .k-state-active,
+.k-tabstrip-right > .k-tabstrip-items .k-state-active,
+.k-panelbar .k-tabstrip-left > .k-tabstrip-items .k-state-active,
+.k-panelbar .k-tabstrip-right > .k-tabstrip-items .k-state-active {
margin-bottom: -1px;
padding-bottom: 0;
}
/* left tabs */
-.k-tabstrip-left .k-tabstrip-items {
+.k-tabstrip-left > .k-tabstrip-items {
float: left;
padding: .25em 0 .3em .3em;
}
-.k-tabstrip-left .k-tabstrip-items .k-item {
+.k-tabstrip-left > .k-tabstrip-items .k-item {
border-width: 1px 0 1px 1px;
border-radius: 3px 0 0 3px;
}
-.k-tabstrip-left .k-tabstrip-items .k-state-active {
+.k-tabstrip-left > .k-tabstrip-items .k-state-active {
border-width: 1px 0 1px 1px;
}
-.k-tabstrip-left .k-tabstrip-items .k-tab-on-top,
-.k-tabstrip-left .k-tabstrip-items .k-state-active,
-.k-tabstrip-left .k-panelbar .k-tabstrip-items .k-state-active {
+.k-tabstrip-left > .k-tabstrip-items .k-tab-on-top,
+.k-tabstrip-left > .k-tabstrip-items .k-state-active,
+.k-panelbar .k-tabstrip-left > .k-tabstrip-items .k-state-active {
margin-right: -2px;
padding-right: 1px;
}
/* right tabs */
-.k-tabstrip-right .k-tabstrip-items {
+.k-tabstrip-right > .k-tabstrip-items {
float: right;
padding: .25em .3em .3em 0;
}
-.k-tabstrip-right .k-tabstrip-items .k-item {
+.k-tabstrip-right > .k-tabstrip-items .k-item {
border-width: 1px 1px 1px 0;
border-radius: 0 3px 3px 0;
}
-.k-tabstrip-right .k-tabstrip-items .k-state-active {
+.k-tabstrip-right > .k-tabstrip-items .k-state-active {
border-width: 1px 1px 1px 0;
}
-.k-tabstrip-right .k-tabstrip-items .k-tab-on-top,
-.k-tabstrip-right .k-tabstrip-items .k-state-active,
-.k-tabstrip-right .k-panelbar .k-tabstrip-items .k-state-active {
+.k-tabstrip-right > .k-tabstrip-items .k-tab-on-top,
+.k-tabstrip-right > .k-tabstrip-items .k-state-active,
+.k-panelbar .k-tabstrip-right > .k-tabstrip-items .k-state-active {
margin-left: -1px;
padding-left: 1px;
}
@@ -2183,7 +2184,7 @@ div.k-window-iframecontent {
.k-tabstrip-bottom > .k-content {
min-height: 100px;
}
-.k-tabstrip-bottom .k-tabstrip-items .k-loading {
+.k-tabstrip-bottom > .k-tabstrip-items .k-loading {
top: auto;
bottom: 0;
}
@@ -2200,8 +2201,8 @@ div.k-window-iframecontent {
zoom: 1;
border-radius: 0;
}
-.k-panelbar .k-image,
-.k-panelbar .k-sprite {
+.k-panelbar .k-link > .k-image,
+.k-panelbar .k-link > .k-sprite {
float: left;
margin-top: 4px;
margin-right: 5px;
@@ -2270,12 +2271,14 @@ div.k-window-iframecontent {
.k-menu .k-item {
-webkit-user-select: none;
-moz-user-select: -moz-none;
- user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.k-menu .k-item div {
-webkit-user-select: default;
- -moz-user-select: default;
- user-select: default;
+ -moz-user-select: default;
+ -ms-user-select: default;
+ user-select: default;
}
.k-menu .k-item .k-item,
ul.k-menu-vertical > .k-item {
@@ -2283,9 +2286,6 @@ ul.k-menu-vertical > .k-item {
float: none;
border-width: 0;
}
-.k-ie7 .k-menu .k-item .k-item {
- zoom: normal;
-}
.k-menu .k-item > .k-link > .k-icon,
.k-menu .k-image,
.k-menu .k-sprite {
@@ -2295,20 +2295,14 @@ ul.k-menu-vertical > .k-item {
.k-menu .k-item > .k-link > .k-icon {
margin: -2px 0 0;
}
-.k-ie7 .k-menu .k-item > .k-link > .k-i-arrow-s,
-.k-ie7 .k-menu .k-image,
-.k-ie7 .k-menu .k-sprite {
- margin-top: 0;
-}
.k-menu .k-item > .k-link {
display: block;
padding: 0.5em 1.1em 0.4em;
line-height: 1.34em;
- -khtml-user-select: none;
-webkit-user-select: none;
- -moz-user-select: -moz-none;
- -ms-user-select: none;
- user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.k-menu .k-menu-group {
display: none;
@@ -2330,8 +2324,7 @@ ul.k-menu-vertical > .k-item {
vertical-align: top;
zoom: 1;
-webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
+ box-sizing: content-box;
}
.k-context-menu.k-menu-vertical > .k-item > .k-link,
.k-menu .k-menu-group .k-item > .k-link {
@@ -2342,15 +2335,11 @@ ul.k-menu-vertical > .k-item {
}
.k-context-menu.k-menu-horizontal > .k-item {
-webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
+ box-sizing: border-box;
}
.k-context-menu.k-menu-horizontal > .k-last {
border: 0;
}
-.k-ie7 .k-menu .k-menu-group .k-link {
- width: 100%;
-}
.k-menu .k-item > .k-link > .k-i-arrow-s {
margin-right: -8px;
}
@@ -2412,8 +2401,9 @@ ul.k-menu-vertical .k-separator,
.k-context-menu {
border: 0;
-webkit-user-select: none;
- -moz-user-select: -moz-none;
- user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
/* Calendar */
.k-calendar {
@@ -2664,6 +2654,13 @@ span.k-dropdown,
.k-space-right .k-icon {
right: 3px;
}
+/*prevent missing bottom border at some zoom levels*/
+span.k-textbox:after {
+ content: "\a0";
+ display: block;
+ height: .4px;
+ overflow: hidden;
+}
.k-autocomplete,
.k-dropdown-wrap.k-state-focused,
.k-dropdown-wrap.k-state-hover,
@@ -2671,15 +2668,10 @@ span.k-dropdown,
.k-picker-wrap.k-state-hover,
.k-numeric-wrap.k-state-focused,
.k-numeric-wrap.k-state-hover {
- -webkit-transition: box-shadow .15s ease-out;
- -moz-transition: box-shadow .15s ease-out;
- -o-transition: box-shadow .15s ease-out;
- transition: box-shadow .15s ease-out;
+ -webkit-transition: -webkit-box-shadow .15s ease-out;
+ transition: box-shadow .15s ease-out;
-webkit-transition: "box-shadow .15s ease-out";
- -moz-transition: "box-shadow .15s ease-out";
- -ms-transition: "box-shadow .15s ease-out";
- -o-transition: "box-shadow .15s ease-out";
- transition: "box-shadow .15s ease-out";
+ transition: "box-shadow .15s ease-out";
}
.k-textbox > input,
.k-picker-wrap .k-input,
@@ -2700,12 +2692,6 @@ span.k-dropdown,
.k-selectbox .k-input {
background: transparent;
}
-.k-ie7 .k-picker-wrap .k-input,
-.k-ie7 .k-numeric-wrap .k-input,
-.k-ie7 .k-combobox .k-input {
- margin: -1px 0;
-}
-/* removes excessive spacing */
.k-picker-wrap .k-select,
.k-numeric-wrap .k-select,
.k-dropdown-wrap .k-select {
@@ -2763,15 +2749,20 @@ span.k-datetimepicker .k-select + .k-select {
border: 0;
margin: 0;
}
-/* fix missing bottom border on browser zoom in Chrome */
-.k-webkit .k-combobox .k-dropdown-wrap:before,
-.k-webkit .k-picker-wrap:before,
-.k-webkit .k-numeric-wrap:before {
+.k-combobox .k-dropdown-wrap:before,
+.k-picker-wrap:before,
+.k-numeric-wrap:before {
content: "\a0";
display: inline-block;
width: 0;
height: 1.65em;
- padding-bottom: 0.4em;
+ padding-bottom: 0.3em;
+}
+/* fix missing bottom border on browser zoom in Chrome */
+.k-webkit .k-combobox .k-dropdown-wrap:before,
+.k-webkit .k-picker-wrap:before,
+.k-webkit .k-numeric-wrap:before {
+ padding-bottom: 0.38em;
}
/* above style breaks NumericTextBox layout due display:block style applied to the input */
.km.root .k-combobox .k-dropdown-wrap:before,
@@ -2784,13 +2775,6 @@ span.k-datetimepicker .k-select + .k-select {
.k-numeric-wrap .k-input {
display: inline;
}
-.k-ie7 .k-autocomplete .k-input,
-.k-ie7 .k-picker-wrap .k-input,
-.k-ie7 .k-numeric-wrap .k-input,
-.k-ie7 .k-dropdown-wrap .k-input,
-.k-ie7 .k-selectbox .k-input {
- text-indent: 0;
-}
.k-picker-wrap .k-select,
.k-numeric-wrap .k-select,
.k-dropdown-wrap .k-select {
@@ -2808,13 +2792,6 @@ span.k-datetimepicker .k-select + .k-select {
body .k-datetimepicker .k-select {
border-radius: 0;
}
-.k-ie7 .k-picker-wrap .k-icon,
-.k-ie7 .k-dropdown-wrap .k-icon {
- line-height: 2em;
- font-size: 1em;
- padding-top: 16px;
- height: 0;
-}
.k-combobox .k-icon,
.k-dropdown,
.k-selectbox .k-icon {
@@ -2837,12 +2814,14 @@ body .k-datetimepicker .k-select {
.k-popup .k-list .k-item,
.k-fieldselector .k-list .k-item,
.k-list-optionlabel,
-.k-popup > .k-static-header {
+.k-popup > .k-group-header,
+.k-popup > .k-virtual-wrap > .k-group-header {
padding: 1px 5px 1px 5px;
line-height: 1.8em;
min-height: 1.8em;
}
-.k-popup > .k-static-header {
+.k-popup > .k-group-header,
+.k-popup > .k-virtual-wrap > .k-group-header {
padding-right: 22px;
}
.k-overflow-container .k-item {
@@ -2876,8 +2855,8 @@ body .k-datetimepicker .k-select {
}
.k-list-filter > .k-icon {
position: absolute;
- right: 4px;
- top: 3px;
+ right: 6px;
+ top: 1px;
}
/* MultiSelect */
.k-multiselect-wrap {
@@ -2899,11 +2878,15 @@ body .k-datetimepicker .k-select {
margin: 1px 0 0;
float: left;
}
+.k-multiselect-wrap .k-input::-ms-clear {
+ display: none;
+}
.k-multiselect-wrap li {
margin: 1px 0 1px 1px;
- padding: .1em .15em .1em .4em;
+ padding: .1em 1.6em .1em .4em;
line-height: 1.5em;
float: left;
+ position: relative;
}
.k-autocomplete .k-loading,
.k-multiselect .k-loading {
@@ -2914,6 +2897,13 @@ body .k-datetimepicker .k-select {
.k-multiselect .k-loading-hidden {
visibility: hidden;
}
+.k-multiselect-wrap .k-select {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ right: 0;
+ padding: .1em .2em;
+}
/* Date/Time Pickers */
.k-datetimepicker .k-picker-wrap {
padding-right: 3.8em;
@@ -2952,6 +2942,9 @@ body .k-datetimepicker .k-select {
}
.k-textbox {
outline: 0;
+}
+input.k-textbox,
+textarea.k-textbox {
padding: 2px .3em;
}
input.k-textbox {
@@ -2965,18 +2958,9 @@ input.k-textbox {
.k-ff input.k-textbox {
height: 2.17em;
}
-.k-ie7 input.k-textbox {
- line-height: 1.72em;
- height: 1.72em;
- text-indent: 0.33em;
-}
textarea.k-textbox {
height: auto;
}
-.k-ie7 .k-textbox {
- padding: 1px 0;
- text-indent: 0;
-}
/* NumericTextBox */
span.k-numerictextbox {
background-color: transparent;
@@ -3034,7 +3018,7 @@ span.k-numerictextbox {
bottom: -3px;
border-radius: 0 !important;
}
-.k-colorpicker .k-icon {
+.k-colorpicker .k-select {
cursor: pointer;
}
.k-disabled-overlay {
@@ -3065,12 +3049,20 @@ span.k-numerictextbox {
overflow: hidden;
-ms-high-contrast-adjust: none;
}
-.k-colorpalette .k-item.k-state-selected {
+.k-colorpalette .k-item.k-state-selected,
+.k-colorpalette .k-item.k-state-selected:hover {
z-index: 100;
background: transparent;
- box-shadow: 0 1px 4px #000, inset 0 0 3px #fff;
+ -webkit-box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
+ box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
position: relative;
}
+.k-colorpalette .k-item:hover {
+ z-index: 101;
+ position: relative;
+ -webkit-box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
+ box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
+}
.k-flatcolorpicker {
position: relative;
display: inline-block;
@@ -3095,11 +3087,10 @@ div.k-flatcolorpicker {
}
.k-flatcolorpicker .k-hsv-rectangle {
position: relative;
- -khtml-user-select: none;
-webkit-user-select: none;
- -moz-user-select: -moz-none;
- -ms-user-select: none;
- user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
-ms-touch-action: pinch-zoom double-tap-zoom;
}
.k-flatcolorpicker .k-hsv-rectangle .k-draghandle {
@@ -3115,7 +3106,7 @@ div.k-flatcolorpicker {
margin-top: -5px;
border-radius: 6px;
-webkit-box-shadow: 0 1px 2px #444444;
- box-shadow: 0 1px 2px #444444;
+ box-shadow: 0 1px 2px #444444;
background: transparent;
}
.k-flatcolorpicker .k-hsv-rectangle .k-draghandle:hover,
@@ -3123,7 +3114,7 @@ div.k-flatcolorpicker {
background: transparent;
border-color: #fff;
-webkit-box-shadow: 0 1px 5px #000000;
- box-shadow: 0 1px 5px #000000;
+ box-shadow: 0 1px 5px #000000;
}
.k-flatcolorpicker .k-hsv-rectangle.k-dragging,
.k-flatcolorpicker .k-hsv-rectangle.k-dragging * {
@@ -3136,7 +3127,7 @@ div.k-flatcolorpicker {
}
.k-flatcolorpicker .k-slider-horizontal .k-slider-track {
-webkit-box-shadow: 0 1px 0 #fff, 0 -1px 0 #999;
- box-shadow: 0 1px 0 #fff, 0 -1px 0 #999;
+ box-shadow: 0 1px 0 #fff, 0 -1px 0 #999;
}
.k-flatcolorpicker .k-hue-slider,
.k-flatcolorpicker .k-transparency-slider {
@@ -3154,7 +3145,7 @@ div.k-flatcolorpicker {
height: 8px;
width: 8px;
-webkit-box-shadow: 0 1px 4px #444444;
- box-shadow: 0 1px 4px #444444;
+ box-shadow: 0 1px 4px #444444;
}
.k-flatcolorpicker .k-hue-slider .k-draghandle:hover,
.k-flatcolorpicker .k-transparency-slider .k-draghandle:hover,
@@ -3163,27 +3154,19 @@ div.k-flatcolorpicker {
background: transparent;
border-color: #fff;
-webkit-box-shadow: 0 1px 5px #000000;
- box-shadow: 0 1px 5px #000000;
+ box-shadow: 0 1px 5px #000000;
border-width: 2px;
padding: 1px;
}
.k-flatcolorpicker .k-hue-slider .k-slider-track {
- background: -moz-linear-gradient(left, #ff0000 0%, #ffff00 16%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 84%, #ff0004 100%);
- /* FF3.6+ */
- background: -webkit-gradient(linear, left top, right top, color-stop(0%, #ff0000), color-stop(16%, #ffff00), color-stop(33%, #00ff00), color-stop(50%, #00ffff), color-stop(67%, #0000ff), color-stop(84%, #ff00ff), color-stop(100%, #ff0004));
- /* Chrome,Safari4+ */
+ background: -webkit-gradient(linear, left top, right top, from(#ff0000), color-stop(16%, #ffff00), color-stop(33%, #00ff00), color-stop(50%, #00ffff), color-stop(67%, #0000ff), color-stop(84%, #ff00ff), to(#ff0004));
background: -webkit-linear-gradient(left, #ff0000 0%, #ffff00 16%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 84%, #ff0004 100%);
- /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(left, #ff0000 0%, #ffff00 16%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 84%, #ff0004 100%);
- /* Opera 11.10+ */
- background: -ms-linear-gradient(left, #ff0000 0%, #ffff00 16%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 84%, #ff0004 100%);
- /* IE10+ */
- background: -left-linear-gradient(left,#ff0000 0%,#ffff00 16%,#00ff00 33%,#00ffff 50%,#0000ff 67%,#ff00ff 84%,#ff0004 100%);
- /* W3C */
+ background: linear-gradient(to right, #ff0000 0%, #ffff00 16%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 84%, #ff0004 100%);
}
.k-flatcolorpicker .k-transparency-slider .k-slider-track {
background-image: url("textures/transparency.png");
- background-size: 100% auto;
+ -webkit-background-size: 100% auto;
+ background-size: 100% auto;
background-position: 100% 50%;
background-repeat: no-repeat;
}
@@ -3197,18 +3180,9 @@ div.k-flatcolorpicker {
width: 6em;
}
.k-flatcolorpicker .k-hsv-gradient {
- background: -moz-linear-gradient(top, rgba(0, 0, 0, 0) 0%, #000000 100%), /* FF3.6+ */ -moz-linear-gradient(left, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
- /* FF3.6+ */
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(0, 0, 0, 0)), color-stop(100%, #000000)), /* Chrome,Safari4+ */ -webkit-gradient(linear, left top, right top, color-stop(0%, #ffffff), color-stop(100%, rgba(255, 255, 255, 0)));
- /* Chrome,Safari4+ */
- background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, #000000 100%), /* Chrome10+,Safari5.1+ */ -webkit-linear-gradient(left, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
- /* Chrome10+,Safari5.1+ */
- background: -o-linear-gradient(top, rgba(0, 0, 0, 0) 0%, #000000 100%), /* Opera 11.10+ */ -o-linear-gradient(left, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
- /* Opera 11.10+ */
- background: -ms-linear-gradient(top, rgba(0, 0, 0, 0) 0%, #000000 100%), /* IE10+ */ -ms-linear-gradient(left, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
- /* IE10+ */
- background: -top-linear-gradient(top,rgba(0,0,0,0) 0%,#000000 100%), /* W3C */ -left-linear-gradient(left,#ffffff 0%,rgba(255,255,255,0) 100%);
- /* W3C */
+ background: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(#000000)), -webkit-gradient(linear, left top, right top, from(#ffffff), to(rgba(255, 255, 255, 0)));
+ background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0) 0%, #000000 100%), -webkit-linear-gradient(left, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
+ background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, #000000 100%), linear-gradient(to right, #ffffff 0%, rgba(255, 255, 255, 0) 100%);
height: 180px;
margin-bottom: 5px;
}
@@ -3218,15 +3192,12 @@ div.k-flatcolorpicker {
.k-ie9 .k-flatcolorpicker .k-hsv-gradient {
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzAwMDAwMCIgc3RvcC1vcGFjaXR5PSIwIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMwMDAwMDAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+), url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMCIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
}
-.k-ie7 .k-flatcolorpicker .k-hue-slider .k-slider-track,
.k-ie8 .k-flatcolorpicker .k-hue-slider .k-slider-track {
background: url("textures/hue.png") repeat 0 50%;
}
-.k-ie7 .k-flatcolorpicker .k-transparency-slider .k-slider-track,
.k-ie8 .k-flatcolorpicker .k-transparency-slider .k-slider-track {
background: url("textures/transparency.png") repeat 0 50%;
}
-.k-ie7 .k-flatcolorpicker .k-hsv-gradient,
.k-ie8 .k-flatcolorpicker .k-hsv-gradient {
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#00ffffff',GradientType=1) progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#ff000000',GradientType=0);
}
@@ -3331,7 +3302,7 @@ div.k-flatcolorpicker {
}
.k-progressbar-horizontal .k-item,
.k-rtl .k-progressbar-horizontal.k-progressbar-reverse .k-item {
- border-width: 1px 1px 1px 0;
+ border-width: 1px 0 1px 1px;
}
.k-progressbar-horizontal.k-progressbar-reverse .k-item,
.k-rtl .k-progressbar-horizontal .k-item {
@@ -3340,17 +3311,22 @@ div.k-flatcolorpicker {
.k-progressbar-horizontal .k-first,
.k-rtl .k-progressbar-horizontal .k-last,
.k-rtl .k-progressbar-horizontal.k-progressbar-reverse .k-last {
- border-radius: 4px 0 0 4px;
+ border-top-left-radius: 4px;
+ border-bottom-left-radius: 4px;
border-left-width: 1px;
}
.k-progressbar-horizontal .k-last,
.k-rtl .k-progressbar-horizontal .k-first {
- border-radius: 0 4px 4px 0;
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 4px;
}
.k-progressbar-horizontal.k-progressbar-reverse .k-last,
.k-rtl .k-progressbar-horizontal .k-first {
border-right-width: 1px;
}
+.k-progressbar-horizontal .k-last.k-state-selected {
+ border-right-width: 1px;
+}
.k-progressbar-vertical .k-item {
width: 100%;
border-style: solid;
@@ -3364,10 +3340,12 @@ div.k-flatcolorpicker {
border-bottom-width: 0;
}
.k-progressbar-vertical .k-first {
- border-radius: 4px 4px 0 0;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
}
.k-progressbar-vertical .k-last {
- border-radius: 0 0 4px 4px;
+ border-bottom-left-radius: 4px;
+ border-bottom-right-radius: 4px;
border-bottom-width: 1px;
}
.k-progressbar-vertical.k-progressbar-reverse .k-item {
@@ -3417,31 +3395,19 @@ div.k-flatcolorpicker {
}
.k-progressbar-vertical .k-progress-status {
-webkit-transform: rotate(-90deg) translateX(-100%);
- -moz-transform: rotate(-90deg) translateX(-100%);
- -ms-transform: rotate(-90deg) translateX(-100%);
- -o-transform: rotate(-90deg) translateX(-100%);
- transform: rotate(-90deg) translateX(-100%);
+ -ms-transform: rotate(-90deg) translateX(-100%);
+ transform: rotate(-90deg) translateX(-100%);
-webkit-transform-origin: 0 0;
- -moz-transform-origin: 0 0;
- -ms-transform-origin: 0 0;
- -o-transform-origin: 0 0;
- transform-origin: 0 0;
+ -ms-transform-origin: 0 0;
+ transform-origin: 0 0;
}
.k-progressbar-vertical.k-progressbar-reverse .k-progress-status {
-webkit-transform: rotate(90deg) translateX(-100%);
- -moz-transform: rotate(90deg) translateX(-100%);
- -ms-transform: rotate(90deg) translateX(-100%);
- -o-transform: rotate(90deg) translateX(-100%);
- transform: rotate(90deg) translateX(-100%);
+ -ms-transform: rotate(90deg) translateX(-100%);
+ transform: rotate(90deg) translateX(-100%);
-webkit-transform-origin: 0 100%;
- -moz-transform-origin: 0 100%;
- -ms-transform-origin: 0 100%;
- -o-transform-origin: 0 100%;
- transform-origin: 0 100%;
-}
-.k-ie7 .k-progressbar-vertical .k-progress-status {
- writing-mode: tb-rl;
- padding: .5em 0;
+ -ms-transform-origin: 0 100%;
+ transform-origin: 0 100%;
}
.k-ie8 .k-progressbar-vertical .k-progress-status {
writing-mode: bt-lr;
@@ -3452,11 +3418,10 @@ div.k-slider {
position: relative;
border-width: 0;
background-color: transparent;
- -khtml-user-select: none;
-webkit-user-select: none;
- -moz-user-select: -moz-none;
- -ms-user-select: none;
- user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.k-slider-vertical {
width: 26px;
@@ -3511,9 +3476,6 @@ div.k-slider {
.k-slider .k-tick {
cursor: pointer;
}
-.k-ie7 .k-slider .k-icon {
- margin-top: 2px;
-}
.k-slider-track,
.k-slider-selection {
position: absolute;
@@ -3591,12 +3553,6 @@ div.k-slider {
height: 100%;
text-align: center;
}
-/* fixes ticks position and removes spacing between them in IE7 */
-.k-ie7 .k-slider-vertical .k-tick {
- float: left;
- clear: left;
- width: 100%;
-}
.k-slider-horizontal .k-tick {
background-position: center -92px;
}
@@ -3758,8 +3714,8 @@ div.k-slider {
position: absolute;
z-index: 12000;
border-style: solid;
- border-width: 1px;
- padding: 4px 5px 4px 6px;
+ border-width: 0;
+ padding: 5px 5px 5px 6px;
background-repeat: repeat-x;
min-width: 20px;
/*slider tooltip only*/
@@ -3794,20 +3750,20 @@ span.k-tooltip {
border-color: transparent;
}
.k-callout-n {
- top: -13px;
+ top: -12px;
left: 50%;
}
.k-callout-w {
top: 50%;
- left: -13px;
+ left: -12px;
}
.k-callout-s {
left: 50%;
- bottom: -13px;
+ bottom: -12px;
}
.k-callout-e {
top: 50%;
- right: -13px;
+ right: -12px;
}
.k-slider-tooltip .k-callout-n,
.k-slider-tooltip .k-callout-s {
@@ -4007,11 +3963,10 @@ span.k-tooltip {
border-style: solid;
font-size: 0;
outline: 0;
- -khtml-user-select: none;
-webkit-user-select: none;
- -moz-user-select: -moz-none;
- -ms-user-select: none;
- user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
}
.k-splitter .k-ghost-splitbar-horizontal,
.k-splitter .k-splitbar-horizontal {
@@ -4197,26 +4152,275 @@ span.k-tooltip {
.k-ie7 .k-task-summary,
.k-ie7 .k-task-actions:first-child > .k-link,
.k-ie7 .k-task-wrap:hover .k-task-delete,
-.k-ie7 .k-task-wrap-active .k-task-delete {
+.k-ie7 .k-task-wrap-active .k-task-delete,
+.k-ie7 .k-navigator,
+.k-ie7 .k-zoom-control,
+.k-ie7 .k-sparkline,
+.k-ie7 .k-sparkline span {
display: inline;
zoom: 1;
}
+/* IE7 zooms */
.k-ie7 .k-treeview .k-item,
.k-ie7 .k-treeview .k-group {
zoom: 1;
}
+/* IE7 textboxes */
.k-ie7 .k-edit-field > .k-textbox {
text-indent: 0;
}
-/* Virtual List */
-.k-virtual-wrap {
+/* IE7 icons */
+.k-ie7 .k-icon,
+.k-ie7 .k-sprite {
+ text-indent: 0;
+}
+/* IE7 disabled state */
+.k-ie7 .k-state-disabled {
+ filter: alpha(opacity=70);
+}
+/* IE7 Button */
+.k-ie7 .k-button {
+ line-height: normal;
+ overflow: visible;
+ margin-right: 4px;
+}
+.k-ie7 a.k-button {
+ line-height: 1.6;
+ padding-left: 7px;
+ padding-right: 7px;
+ /*+1*/
+}
+.k-ie7 .k-button-expand {
+ margin-left: 0;
+ margin-right: 0;
+}
+.k-ie7 a.k-button-icon {
+ padding-left: 5px;
+ padding-right: 5px;
+ /*+1*/
+}
+/* IE7 input widgets */
+.k-ie7 .k-picker-wrap .k-input,
+.k-ie7 .k-numeric-wrap .k-input,
+.k-ie7 .k-combobox .k-input {
+ margin: -1px 0;
+}
+/* removes excessive spacing */
+.k-ie7 .k-autocomplete .k-input,
+.k-ie7 .k-picker-wrap .k-input,
+.k-ie7 .k-numeric-wrap .k-input,
+.k-ie7 .k-dropdown-wrap .k-input,
+.k-ie7 .k-selectbox .k-input {
+ text-indent: 0;
+}
+.k-ie7 .k-picker-wrap .k-icon,
+.k-ie7 .k-dropdown-wrap .k-icon {
+ /*use alternative approach for vertical expansion, instead of min-height and height*/
+ line-height: 2em;
+ font-size: 1em;
+ padding-top: 16px;
+ height: 0;
+}
+.k-ie7 input.k-textbox {
+ line-height: 1.72em;
+ height: 1.72em;
+ text-indent: .33em;
+}
+.k-ie7 .k-textbox {
+ padding: 1px 0;
+ text-indent: 0;
+}
+/*IE7 ColorPicker*/
+.k-ie7 .k-flatcolorpicker .k-hue-slider .k-slider-track {
+ background: url("textures/hue.png") repeat 0 50%;
+}
+.k-ie7 .k-flatcolorpicker .k-transparency-slider .k-slider-track {
+ background: url("textures/transparency.png") repeat 0 50%;
+}
+.k-ie7 .k-flatcolorpicker .k-hsv-gradient {
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#00ffffff',GradientType=1) progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#ff000000',GradientType=0);
+}
+/*IE7 Editor*/
+.k-ie7 .k-editor-toolbar li {
+ display: inline;
+ /* required. Floats and the inline-block hack break it */
+}
+.k-ie7 .k-filebrowser .k-upload-button,
+.k-ie7 .k-filebrowser .k-upload .k-icon {
+ vertical-align: baseline;
+ position: relative;
+ top: 1px;
+}
+.k-ie7 .k-filebrowser .k-upload .k-icon {
+ top: 2px;
+}
+.k-ie7 .k-filebrowser .k-filebrowser-toolbar .k-button-icon {
+ vertical-align: middle;
+}
+/*IE7 Gantt*/
+.k-ie7 .k-task-milestone {
+ margin-left: 1px;
+ /*+1*/
+}
+/* IE7 Grid */
+.k-ie7 .k-grid-content table {
+ width: auto;
+}
+.k-ie7 .k-pager-wrap .k-textbox {
+ height: 1.3333em;
+ margin-top: 0.16666em;
+ display: inline;
+}
+.k-ie7 .k-pager-sizes {
+ float: left;
+}
+.k-ie7 .k-dirty-cell {
+ position: relative;
+}
+.k-ie7 .k-dirty {
+ top: 5px;
+}
+.k-ie7 .k-grid-actions {
+ vertical-align: bottom;
+}
+.k-ie7 .k-grid tbody a.k-button {
+ min-width: 62px;
+ /*-2*/
+}
+.k-ie7 .k-edit-cell > .text-box,
+.k-ie7 .k-edit-cell > .k-textbox,
+.k-ie7 .k-edit-cell > .k-widget,
+.k-ie7 .k-grid-edit-row > td > .k-textbox,
+.k-ie7 .k-grid-edit-row > td > .k-widget,
+.k-ie7 .k-grid-edit-row > td > .text-box {
+ display: block;
+ width: 90%;
+}
+.k-ie7 .k-multicheck-wrap {
position: relative;
}
-.k-virtual-wrap > .k-list {
+/*IE7 Menu*/
+.k-ie7 .k-menu .k-item .k-item {
+ zoom: normal;
+}
+.k-ie7 .k-menu .k-item > .k-link > .k-i-arrow-s,
+.k-ie7 .k-menu .k-image,
+.k-ie7 .k-menu .k-sprite {
+ margin-top: 0;
+ /*+2*/
+}
+.k-ie7 .k-menu .k-menu-group .k-link {
+ width: 100%;
+}
+/*IE7 ProgressBar */
+.k-ie7 .k-progressbar-vertical .k-progress-status {
+ /*instead of transforms*/
+ writing-mode: tb-rl;
+ padding: .5em 0;
+}
+/*IE7 Scheduler*/
+.k-ie7 .k-scheduler-toolbar .k-nav-prev .k-link,
+.k-ie7 .k-scheduler-toolbar .k-nav-next .k-link {
+ height: 2.3em;
+ margin-top: -1px;
+ vertical-align: middle;
+}
+.k-ie7 .k-scheduler-toolbar .k-nav-prev .k-link .k-icon,
+.k-ie7 .k-scheduler-toolbar .k-nav-next .k-link .k-icon {
+ margin-top: .5em;
+}
+.k-ie7 .k-scheduler-content .k-scheduler-table {
+ width: auto;
+}
+/* IE7 Slider */
+.k-ie7 .k-slider .k-icon {
+ margin-top: 2px;
+}
+/* fixes ticks position and removes spacing between them in IE7 */
+.k-ie7 .k-slider-vertical .k-tick {
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.k-ie7 .k-slider a.k-button {
+ height: 22px;
+ line-height: 22px;
+ padding: 0;
+}
+/*IE7 TabStrip */
+.k-ie7 .k-tabstrip-items .k-item .k-image,
+.k-ie7 .k-tabstrip-items .k-item .k-sprite {
+ margin-top: -1px;
+ vertical-align: top;
+}
+/* IE7 Upload */
+.k-ie7 .k-dropzone em,
+.k-ie7 .k-upload-button {
+ vertical-align: baseline;
+}
+.k-ie7 .k-upload-button {
+ margin: .8em;
+}
+.k-ie7 .k-upload-files .k-button {
+ line-height: 1;
+}
+/*IE7*/
+.k-ie7 .k-upload-selected {
+ min-width: 100px;
+}
+/* IE7 Window */
+/* Compensate for content padding in IE7 */
+.k-ie7 .k-window {
+ padding-bottom: 1.16em;
+}
+.k-ie7 .k-window-titleless {
+ padding-bottom: 0;
+}
+/* IE7 Map */
+.k-ie7 .k-navigator > button {
+ border-width: 0;
+ display: block;
+}
+.k-ie7 .k-navigator > button > span {
+ vertical-align: top;
+ display: block;
+}
+.k-ie7 div.k-navigator .k-navigator-n,
+.k-ie7 div.k-navigator .k-navigator-s {
+ margin-left: -8px;
+ /*+1*/
+}
+.k-ie7 div.k-navigator .k-navigator-w,
+.k-ie7 div.k-navigator .k-navigator-e {
+ margin-top: -8px;
+ /*+1*/
+}
+.k-ie7 .k-zoom-control .k-button {
margin: 0;
+ /*-14*/
+}
+/*IE7 TreeMap */
+.k-ie7 .k-treemap .k-treemap-tile {
+ border-width: 0;
padding: 0;
}
-.k-virtual-list {
+.k-ie7 .k-treemap .k-leaf > div {
+ padding: 7px;
+}
+.k-ie7 .k-treemap .k-leaf.k-state-hover {
+ border-width: 1px;
+}
+.k-ie7 .k-treemap .k-leaf.k-state-hover > div {
+ padding: 6px;
+}
+/* Virtual List */
+.k-virtual-wrap {
+ position: relative;
+}
+.k-virtual-wrap .k-list.k-virtual-list {
+ height: auto;
+}
+.k-virtual-content {
overflow-y: scroll;
/* has to be scroll, not auto */
-webkit-overflow-scrolling: touch;
@@ -4239,39 +4443,49 @@ span.k-tooltip {
.k-virtual-wrap > .k-virtual-header {
text-align: right;
}
-.k-popup .k-list .k-item.k-virtual-item {
- /*padding: 1px 0;*/
+.k-popup .k-item.k-first {
+ position: relative;
}
-.k-virtual-list .k-virtual-item {
+.k-virtual-content > .k-virtual-list > .k-virtual-item {
position: absolute;
width: 100%;
- box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ overflow: hidden;
+ white-space: nowrap;
}
-.k-popup .k-item.k-first {
- position: relative;
+.k-popup .k-list .k-item > .k-group,
+.k-popup > .k-group-header,
+.k-popup > .k-virtual-wrap > .k-group-header {
+ text-transform: uppercase;
+ font-size: .857em;
}
-.k-popup .k-item > .k-group {
- background: none;
+.k-popup .k-list .k-item > .k-group {
position: absolute;
top: 0;
- right: .3em;
+ right: 0;
+ padding: 0 .5em;
+ line-height: 1.8;
}
-.k-popup .k-item.k-first,
-.k-virtual-item.k-first {
- border-bottom-style: solid;
- border-bottom-width: 1px;
+.k-popup .k-state-hover > .k-group {
+ right: -1px;
+}
+.k-virtual-item.k-first,
+.k-group-header + .k-list > .k-item.k-first,
+.k-static-header + .k-list > .k-item.k-first {
+ border-top-style: solid;
+ border-top-width: 1px;
+ padding-top: 0;
}
-.k-popup > .k-static-header {
+.k-popup > .k-group-header,
+.k-popup > .k-virtual-wrap > .k-group-header {
text-align: right;
}
/* animation classes */
.k-fx-end .k-fx-next,
.k-fx-end .k-fx-current {
-webkit-transition: all 350ms ease-out;
- -moz-transition: all 350ms ease-out;
- -ms-transition: all 350ms ease-out;
- -o-transition: all 350ms ease-out;
- transition: all 350ms ease-out;
+ transition: all 350ms ease-out;
}
.k-fx {
position: relative;
@@ -4295,39 +4509,29 @@ span.k-tooltip {
/* Zoom */
.k-fx-zoom.k-fx-start .k-fx-next {
-webkit-transform: scale(0) !important;
- -moz-transform: scale(0) !important;
- -ms-transform: scale(0) !important;
- -o-transform: scale(0) !important;
- transform: scale(0) !important;
+ -ms-transform: scale(0) !important;
+ transform: scale(0) !important;
}
.k-fx-zoom.k-fx-end .k-fx-next {
-webkit-transform: scale(1) !important;
- -moz-transform: scale(1) !important;
- -ms-transform: scale(1) !important;
- -o-transform: scale(1) !important;
- transform: scale(1) !important;
+ -ms-transform: scale(1) !important;
+ transform: scale(1) !important;
}
.k-fx-zoom.k-fx-reverse.k-fx-start .k-fx-next,
.k-fx-zoom.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: scale(1) !important;
- -moz-transform: scale(1) !important;
- -ms-transform: scale(1) !important;
- -o-transform: scale(1) !important;
- transform: scale(1) !important;
+ -ms-transform: scale(1) !important;
+ transform: scale(1) !important;
}
.k-fx-zoom.k-fx-reverse.k-fx-start .k-fx-current {
-webkit-transform: scale(1) !important;
- -moz-transform: scale(1) !important;
- -ms-transform: scale(1) !important;
- -o-transform: scale(1) !important;
- transform: scale(1) !important;
+ -ms-transform: scale(1) !important;
+ transform: scale(1) !important;
}
.k-fx-zoom.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: scale(0) !important;
- -moz-transform: scale(0) !important;
- -ms-transform: scale(0) !important;
- -o-transform: scale(0) !important;
- transform: scale(0) !important;
+ -ms-transform: scale(0) !important;
+ transform: scale(0) !important;
}
/* Fade */
.k-fx-fade.k-fx-start .k-fx-next {
@@ -4357,18 +4561,13 @@ span.k-tooltip {
.k-fx-slide.k-fx-end .k-fx-current .km-header,
.k-fx-slide.k-fx-end .k-fx-current .km-footer {
-webkit-transition: all 350ms ease-out;
- -moz-transition: all 350ms ease-out;
- -ms-transition: all 350ms ease-out;
- -o-transition: all 350ms ease-out;
- transition: all 350ms ease-out;
+ transition: all 350ms ease-out;
}
.k-fx-slide.k-fx-start .k-fx-next .km-content {
will-change: transform;
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-slide.k-fx-start .k-fx-next .km-header,
.k-fx-slide.k-fx-start .k-fx-next .km-footer {
@@ -4377,10 +4576,8 @@ span.k-tooltip {
}
.k-fx-slide.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-slide.k-fx-end .k-fx-next .km-header,
.k-fx-slide.k-fx-end .k-fx-next .km-footer {
@@ -4389,31 +4586,23 @@ span.k-tooltip {
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-current .km-content {
will-change: transform;
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-next .km-content {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-slide.k-fx-reverse.k-fx-end .k-fx-next .km-content {
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-current .km-header,
.k-fx-slide.k-fx-reverse.k-fx-start .k-fx-current .km-footer {
@@ -4437,45 +4626,33 @@ span.k-tooltip {
}
.k-fx-slide.k-fx-right.k-fx-start .k-fx-next .km-content {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-slide.k-fx-right.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-start .k-fx-current .km-content {
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-end .k-fx-current .km-content {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-start .k-fx-next .km-content {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-slide.k-fx-right.k-fx-reverse.k-fx-end .k-fx-next .km-content {
-webkit-transform: translatex(0%);
- -moz-transform: translatex(0%);
- -ms-transform: translatex(0%);
- -o-transform: translatex(0%);
- transform: translatex(0%);
+ -ms-transform: translatex(0%);
+ transform: translatex(0%);
}
/* Tile */
.k-fx-tile {
@@ -4486,91 +4663,67 @@ span.k-tooltip {
.k-fx-tile.k-fx-start .k-fx-next {
will-change: transform;
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-current {
will-change: transform;
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-tile.k-fx-right {
/* right reverse */
}
.k-fx-tile.k-fx-right.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-current {
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0%);
- -moz-transform: translatex(0%);
- -ms-transform: translatex(0%);
- -o-transform: translatex(0%);
- transform: translatex(0%);
+ -ms-transform: translatex(0%);
+ transform: translatex(0%);
}
/* Tile */
.k-fx-tile {
@@ -4581,164 +4734,120 @@ span.k-tooltip {
.k-fx-tile.k-fx-start .k-fx-next {
will-change: transform;
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-current {
will-change: transform;
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-tile.k-fx-right {
/* right reverse */
}
.k-fx-tile.k-fx-right.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-current {
-webkit-transform: translatex(0);
- -moz-transform: translatex(0);
- -ms-transform: translatex(0);
- -o-transform: translatex(0);
- transform: translatex(0);
+ -ms-transform: translatex(0);
+ transform: translatex(0);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx-tile.k-fx-right.k-fx-reverse.k-fx-end .k-fx-next {
-webkit-transform: translatex(0%);
- -moz-transform: translatex(0%);
- -ms-transform: translatex(0%);
- -o-transform: translatex(0%);
- transform: translatex(0%);
+ -ms-transform: translatex(0%);
+ transform: translatex(0%);
}
/* Overlay */
.k-fx.k-fx-overlay.k-fx-start .k-fx-next,
.k-fx.k-fx-overlay.k-fx-left.k-fx-start .k-fx-next {
will-change: transform;
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx.k-fx-overlay.k-fx-right.k-fx-start .k-fx-next {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx.k-fx-overlay.k-fx-up.k-fx-start .k-fx-next {
-webkit-transform: translatey(100%);
- -moz-transform: translatey(100%);
- -ms-transform: translatey(100%);
- -o-transform: translatey(100%);
- transform: translatey(100%);
+ -ms-transform: translatey(100%);
+ transform: translatey(100%);
}
.k-fx.k-fx-overlay.k-fx-down.k-fx-start .k-fx-next {
-webkit-transform: translatey(-100%);
- -moz-transform: translatey(-100%);
- -ms-transform: translatey(-100%);
- -o-transform: translatey(-100%);
- transform: translatey(-100%);
+ -ms-transform: translatey(-100%);
+ transform: translatey(-100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-start .k-fx-next {
-webkit-transform: none;
- -moz-transform: none;
- -ms-transform: none;
- -o-transform: none;
- transform: none;
+ -ms-transform: none;
+ transform: none;
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-start .k-fx-current {
will-change: transform;
-webkit-transform: none;
- -moz-transform: none;
- -ms-transform: none;
- -o-transform: none;
- transform: none;
+ -ms-transform: none;
+ transform: none;
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-end .k-fx-current,
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-left.k-fx-end .k-fx-current {
-webkit-transform: translatex(100%);
- -moz-transform: translatex(100%);
- -ms-transform: translatex(100%);
- -o-transform: translatex(100%);
- transform: translatex(100%);
+ -ms-transform: translatex(100%);
+ transform: translatex(100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-right.k-fx-end .k-fx-current {
-webkit-transform: translatex(-100%);
- -moz-transform: translatex(-100%);
- -ms-transform: translatex(-100%);
- -o-transform: translatex(-100%);
- transform: translatex(-100%);
+ -ms-transform: translatex(-100%);
+ transform: translatex(-100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-up.k-fx-end .k-fx-current {
-webkit-transform: translatey(100%);
- -moz-transform: translatey(100%);
- -ms-transform: translatey(100%);
- -o-transform: translatey(100%);
- transform: translatey(100%);
+ -ms-transform: translatey(100%);
+ transform: translatey(100%);
}
.k-fx.k-fx-overlay.k-fx-reverse.k-fx-down.k-fx-end .k-fx-current {
-webkit-transform: translatey(-100%);
- -moz-transform: translatey(-100%);
- -ms-transform: translatey(-100%);
- -o-transform: translatey(-100%);
- transform: translatey(-100%);
+ -ms-transform: translatey(-100%);
+ transform: translatey(-100%);
}
diff --git a/vendor/kendo/kendo.core.js b/vendor/kendo/kendo.core.js
index 4a14045..8ef5128 100644
--- a/vendor/kendo/kendo.core.js
+++ b/vendor/kendo/kendo.core.js
@@ -494,6 +494,8 @@ function pad(number, digits, end) {
symbol: "%"
},
currency: {
+ name: "US Dollar",
+ abbr: "USD",
pattern: ["($n)", "$n"],
decimals: 2,
",": ",",
@@ -1194,6 +1196,8 @@ function pad(number, digits, end) {
var i = 0,
length = names.length,
name, nameLength,
+ matchLength = 0,
+ matchIdx = 0,
subValue;
for (; i < length; i++) {
@@ -1205,11 +1209,17 @@ function pad(number, digits, end) {
subValue = subValue.toLowerCase();
}
- if (subValue == name) {
- valueIdx += nameLength;
- return i + 1;
+ if (subValue == name && nameLength > matchLength) {
+ matchLength = nameLength;
+ matchIdx = i;
}
}
+
+ if (matchLength) {
+ valueIdx += matchLength;
+ return matchIdx + 1;
+ }
+
return null;
},
checkLiteral = function() {
@@ -1269,6 +1279,10 @@ function pad(number, digits, end) {
calendar._lowerDays = lowerLocalInfo(calendar.days);
}
+ if (day !== null && count > 2) {
+ continue;
+ }
+
day = count < 3 ? getNumber(2) : getIndexByName(calendar._lowerDays[count == 3 ? "namesAbbr" : "names"], true);
if (day === null || outOfRange(day, 1, 31)) {
@@ -1478,7 +1492,6 @@ function pad(number, digits, end) {
var date = null;
var length, patterns;
var tzoffset;
- var sign;
if (value && value.indexOf("/D") === 0) {
date = dateRegExp.exec(value);
@@ -1841,6 +1854,38 @@ function pad(number, digits, end) {
return styles;
}
+ function isScrollable(element) {
+ if (element.className.indexOf("k-auto-scrollable") > -1) {
+ return true;
+ }
+
+ var overflow = getComputedStyles(element, ["overflow"]).overflow;
+ return overflow == "auto" || overflow == "scroll";
+ }
+
+ function scrollLeft(element, value) {
+ var el = element instanceof $ ? element[0] : element;
+ var isRtl = support.isRtl(element);
+ var webkit = support.browser.webkit;
+ var mozila = support.browser.mozilla;
+
+ if (value !== undefined) {
+ if (isRtl && webkit) {
+ el.scrollLeft = el.scrollWidth - el.clientWidth - value;
+ } else if (isRtl && mozila) {
+ el.scrollLeft = -value;
+ } else {
+ el.scrollLeft = value;
+ }
+ } else {
+ if (isRtl && webkit) {
+ return el.scrollWidth - el.clientWidth - el.scrollLeft;
+ } else {
+ return Math.abs(el.scrollLeft);
+ }
+ }
+ }
+
(function () {
support._scrollbar = undefined;
@@ -2012,6 +2057,7 @@ function pad(number, digits, end) {
support.detectBrowser = function(ua) {
var browser = false, match = [],
browserRxs = {
+ edge: /(edge)[ \/]([\w.]+)/i,
webkit: /(chrome)[ \/]([\w.]+)/i,
safari: /(webkit)[ \/]([\w.]+)/i,
opera: /(opera)(?:.*version|)[ \/]([\w.]+)/i,
@@ -2040,8 +2086,16 @@ function pad(number, digits, end) {
support.zoomLevel = function() {
try {
- return support.touch ? (document.documentElement.clientWidth / window.innerWidth) :
- support.browser.msie && support.browser.version >= 10 ? ((top || window).document.documentElement.offsetWidth / (top || window).innerWidth) : 1;
+ var browser = support.browser;
+ var ie11WidthCorrection = 0;
+ var docEl = document.documentElement;
+
+ if (browser.msie && browser.version == 11 && docEl.scrollHeight > docEl.clientHeight && !support.touch) {
+ ie11WidthCorrection = support.scrollbar();
+ }
+
+ return support.touch ? (docEl.clientWidth / window.innerWidth) :
+ browser.msie && browser.version >= 10 ? (((top || window).document.documentElement.offsetWidth + ie11WidthCorrection) / (top || window).innerWidth) : 1;
} catch(e) {
return 1;
}
@@ -2065,6 +2119,8 @@ function pad(number, digits, end) {
cssClass = "webkit";
} else if (browser.opera) {
cssClass = "opera";
+ } else if (browser.edge) {
+ cssClass = "edge";
}
if (cssClass) {
@@ -2154,6 +2210,8 @@ function pad(number, digits, end) {
var documentMode = document.documentMode;
support.hashChange = ("onhashchange" in window) && !(support.browser.msie && (!documentMode || documentMode <= 8)); // old IE detection
+
+ support.customElements = ("registerElement" in window.document);
})();
@@ -2173,8 +2231,7 @@ function pad(number, digits, end) {
type = "offset";
}
- var result = element[type](),
- mobileOS = support.mobileOS;
+ var result = element[type]();
// IE10 touch zoom is living in a separate viewport
if (support.browser.msie && (support.pointers || support.msPointers) && !positioned) {
@@ -2440,12 +2497,16 @@ function pad(number, digits, end) {
localUrlRe = /^([a-z]+:)?\/\//i;
extend(kendo, {
+ widgets: [],
+ _widgetRegisteredCallbacks: [],
ui: kendo.ui || {},
fx: kendo.fx || fx,
effects: kendo.effects || effects,
mobile: kendo.mobile || { },
data: kendo.data || {},
dataviz: kendo.dataviz || {},
+ drawing: kendo.drawing || {},
+ spreadsheet: {},
keys: {
INSERT: 45,
DELETE: 46,
@@ -2479,6 +2540,9 @@ function pad(number, digits, end) {
wrap: wrap,
deepExtend: deepExtend,
getComputedStyles: getComputedStyles,
+ webComponents: [],
+ isScrollable: isScrollable,
+ scrollLeft: scrollLeft,
size: size,
toCamelCase: toCamelCase,
toHyphens: toHyphens,
@@ -2513,7 +2577,10 @@ function pad(number, digits, end) {
}
if (safe) {
+ expression = expression.replace(/"([^.]*)\.([^"]*)"/g,'"$1_$DOT$_$2"');
+ expression = expression.replace(/'([^.]*)\.([^']*)'/g,"'$1_$DOT$_$2'");
expression = wrapExpression(expression.split("."), paramName);
+ expression = expression.replace(/_\$DOT\$_/g, ".");
} else {
expression = paramName + expression;
}
@@ -2574,6 +2641,14 @@ function pad(number, digits, end) {
return (/^(label|input|textarea|select)$/i).test(e.target.tagName);
},
+ onWidgetRegistered: function(callback) {
+ for (var i = 0, len = kendo.widgets.length; i < len; i++) {
+ callback(kendo.widgets[i]);
+ }
+
+ kendo._widgetRegisteredCallbacks.push(callback);
+ },
+
logToConsole: function(message) {
var console = window.console;
@@ -2662,9 +2737,9 @@ function pad(number, digits, end) {
var size = this.getSize(),
currentSize = this._size;
- if (force || !currentSize || size.width !== currentSize.width || size.height !== currentSize.height) {
+ if (force || (size.width > 0 || size.height > 0) && (!currentSize || size.width !== currentSize.width || size.height !== currentSize.height)) {
this._size = size;
- this._resize(size);
+ this._resize(size, force);
this.trigger("resize", size);
}
},
@@ -2691,8 +2766,18 @@ function pad(number, digits, end) {
that.element.removeData("handler");
that.unbind();
},
+ _destroy: function() {
+ this.destroy();
+ },
+ angular: function(){},
- angular: function(){}
+ _muteAngularRebind: function(callback) {
+ this._muteRebind = true;
+
+ callback.call(this);
+
+ this._muteRebind = false;
+ }
});
var DataBoundWidget = Widget.extend({
@@ -2982,6 +3067,13 @@ function pad(number, digits, end) {
getter = "getKendo" + prefix + name;
name = "kendo" + prefix + name;
+ var widgetEntry = { name: name, widget: widget, prefix: prefix || "" };
+ kendo.widgets.push(widgetEntry);
+
+ for (var i = 0, len = kendo._widgetRegisteredCallbacks.length; i < len; i++) {
+ kendo._widgetRegisteredCallbacks[i](widgetEntry);
+ }
+
$.fn[name] = function(options) {
var value = this,
args;
@@ -3013,7 +3105,7 @@ function pad(number, digits, end) {
});
} else {
this.each(function() {
- new widget(this, options);
+ return new widget(this, options);
});
}
@@ -3103,6 +3195,10 @@ function pad(number, digits, end) {
kendo.touchScroller = function(elements, options) {
// return the first touch scroller
+ if (!options){ options = {}; }
+
+ options.useNative = true;
+
return $(elements).map(function(idx, element) {
element = $(element);
if (support.kineticScrollNeeded && kendo.mobile.ui.Scroller && !element.data("kendoMobileScroller")) {
@@ -3198,9 +3294,10 @@ function pad(number, digits, end) {
}
function visible(element) {
- return !$(element).parents().addBack().filter(function() {
- return $.css(this,"visibility") === "hidden" || $.expr.filters.hidden(this);
- }).length;
+ return $.expr.filters.visible(element) &&
+ !$(element).parents().addBack().filter(function() {
+ return $.css(this,"visibility") === "hidden";
+ }).length;
}
$.extend($.expr[ ":" ], {
@@ -3884,7 +3981,9 @@ function pad(number, digits, end) {
};
kendo.elementUnderCursor = function(e) {
- return document.elementFromPoint(e.x.client, e.y.client);
+ if (typeof e.x.client != "undefined") {
+ return document.elementFromPoint(e.x.client, e.y.client);
+ }
};
kendo.wheelDeltaY = function(jQueryEvent) {
@@ -4001,16 +4100,12 @@ function pad(number, digits, end) {
return start;
};
- kendo.compileMobileDirective = function(element, scopeSetup) {
+ kendo.compileMobileDirective = function(element, scope) {
var angular = window.angular;
element.attr("data-" + kendo.ns + "role", element[0].tagName.toLowerCase().replace('kendo-mobile-', '').replace('-', ''));
angular.element(element).injector().invoke(["$compile", function($compile) {
- var scope = angular.element(element).scope();
- if (scopeSetup) {
- scopeSetup(scope);
- }
$compile(element)(scope);
if (!/^\$(digest|apply)$/.test(scope.$$phase)) {
@@ -4037,6 +4132,35 @@ function pad(number, digits, end) {
return tokens;
};
+ kendo.cycleForm = function(form) {
+ var firstElement = form.find("input, .k-widget").first();
+ var lastElement = form.find("button, .k-button").last();
+
+ function focus(el) {
+ var widget = kendo.widgetInstance(el);
+
+ if (widget && widget.focus) {
+ widget.focus();
+ } else {
+ el.focus();
+ }
+ }
+
+ lastElement.on("keydown", function(e) {
+ if (e.keyCode == kendo.keys.TAB && !e.shiftKey) {
+ e.preventDefault();
+ focus(firstElement);
+ }
+ });
+
+ firstElement.on("keydown", function(e) {
+ if (e.keyCode == kendo.keys.TAB && e.shiftKey) {
+ e.preventDefault();
+ focus(lastElement);
+ }
+ });
+ };
+
// kendo.saveAs -----------------------------------------------
(function() {
function postToProxy(dataURI, fileName, proxyURL, proxyTarget) {
diff --git a/vendor/kendo/kendo.data.js b/vendor/kendo/kendo.data.js
index 50dc58c..8388d53 100644
--- a/vendor/kendo/kendo.data.js
+++ b/vendor/kendo/kendo.data.js
@@ -18,10 +18,6 @@
define([ "./kendo.core", "./kendo.data.odata", "./kendo.data.xml" ], f);
})(function(){
-var A = 0;
-
-
-
/*jshint eqnull: true, loopfunc: true, evil: true */
(function($, undefined) {
var extend = $.extend,
@@ -278,6 +274,41 @@ var A = 0;
return result;
},
+ reduce: function(callback) {
+ var idx = 0,
+ result,
+ length = this.length;
+
+ if (arguments.length == 2) {
+ result = arguments[1];
+ } else if (idx < length) {
+ result = this[idx++];
+ }
+
+ for (; idx < length; idx++) {
+ result = callback(result, this[idx], idx, this);
+ }
+
+ return result;
+ },
+
+ reduceRight: function(callback) {
+ var idx = this.length - 1,
+ result;
+
+ if (arguments.length == 2) {
+ result = arguments[1];
+ } else if (idx > 0) {
+ result = this[idx--];
+ }
+
+ for (; idx >= 0; idx--) {
+ result = callback(result, this[idx], idx, this);
+ }
+
+ return result;
+ },
+
filter: function(callback) {
var idx = 0,
result = [],
@@ -410,6 +441,8 @@ var A = 0;
Observable.fn.init.call(this);
+ this._handlers = {};
+
for (field in value) {
member = value[field];
@@ -424,7 +457,7 @@ var A = 0;
},
shouldSerialize: function(field) {
- return this.hasOwnProperty(field) && field !== "_events" && typeof this[field] !== FUNCTION && field !== "uid";
+ return this.hasOwnProperty(field) && field !== "_handlers" && field !== "_events" && typeof this[field] !== FUNCTION && field !== "uid";
},
forEach: function(f) {
@@ -497,6 +530,12 @@ var A = 0;
current = kendo.getter(field, true)(that);
if (current !== value) {
+ if (current instanceof Observable && this._handlers[field]) {
+ if (this._handlers[field].get) {
+ current.unbind(GET, this._handlers[field].get);
+ }
+ current.unbind(CHANGE, this._handlers[field].change);
+ }
if (!that.trigger("set", { field: field, value: value })) {
if (!composite) {
@@ -512,8 +551,10 @@ var A = 0;
parent: noop,
wrap: function(object, field, parent) {
- var that = this,
- type = toString.call(object);
+ var that = this;
+ var get;
+ var change;
+ var type = toString.call(object);
if (object != null && (type === "[object Object]" || type === "[object Array]")) {
var isObservableArray = object instanceof ObservableArray;
@@ -524,18 +565,22 @@ var A = 0;
object = new ObservableObject(object);
}
- if (object.parent() != parent()) {
- object.bind(GET, eventHandler(that, GET, field, true));
- object.bind(CHANGE, eventHandler(that, CHANGE, field, true));
- }
+ get = eventHandler(that, GET, field, true);
+ object.bind(GET, get);
+ change = eventHandler(that, CHANGE, field, true);
+ object.bind(CHANGE, change);
+
+ that._handlers[field] = { get: get, change: change };
} else if (type === "[object Array]" || isObservableArray || isDataSource) {
if (!isObservableArray && !isDataSource) {
object = new ObservableArray(object);
}
- if (object.parent() != parent()) {
- object.bind(CHANGE, eventHandler(that, CHANGE, field, false));
- }
+ change = eventHandler(that, CHANGE, field, false);
+
+ object.bind(CHANGE, change);
+
+ that._handlers[field] = { change: change };
}
object.parent = parent;
@@ -1023,6 +1068,20 @@ var A = 0;
return a + ".lastIndexOf('" + b + "', 0) == 0";
},
+ doesnotstartwith: function(a, b, ignore) {
+ if (ignore) {
+ a = "(" + a + " || '').toLowerCase()";
+ if (b) {
+ b = b.toLowerCase();
+ }
+ }
+
+ if (b) {
+ b = quote(b);
+ }
+
+ return a + ".lastIndexOf('" + b + "', 0) == -1";
+ },
endswith: function(a, b, ignore) {
if (ignore) {
a = "(" + a + " || '').toLowerCase()";
@@ -1037,6 +1096,20 @@ var A = 0;
return a + ".indexOf('" + b + "', " + a + ".length - " + (b || "").length + ") >= 0";
},
+ doesnotendwith: function(a, b, ignore) {
+ if (ignore) {
+ a = "(" + a + " || '').toLowerCase()";
+ if (b) {
+ b = b.toLowerCase();
+ }
+ }
+
+ if (b) {
+ b = quote(b);
+ }
+
+ return a + ".indexOf('" + b + "', " + a + ".length - " + (b || "").length + ") < 0";
+ },
contains: function(a, b, ignore) {
if (ignore) {
a = "(" + a + " || '').toLowerCase()";
@@ -1889,34 +1962,6 @@ var A = 0;
}
});
- function cloneGroups(groups) {
- var result = [];
- var item;
- var group;
-
- for (var idx = 0, length = groups.length; idx < length; idx++) {
- item = groups[idx];
- if (!("field" in item && "items" in item && "value" in item)) {
- break;
- }
-
- group = {};
- for (var field in item) {
- var shouldSerialize = item.shouldSerialize ? item.shouldSerialize : item.hasOwnProperty;
- if (shouldSerialize.call(item, field)) {
- group[field] = item[field];
- }
- }
-
- result.push(group);
-
- if (group.hasSubgroups) {
- result = result.concat(cloneGroups(group.items));
- }
- }
- return result;
- }
-
function mergeGroups(target, dest, skip, take) {
var group,
idx = 0,
@@ -1989,7 +2034,7 @@ var A = 0;
}
function wrapGroupItems(data, model) {
- var idx, length, group, items;
+ var idx, length, group;
if (model) {
for (idx = 0, length = data.length; idx < length; idx++) {
group = data.at(idx);
@@ -2071,34 +2116,10 @@ var A = 0;
}
}
- function wrapInEmptyGroup(groups, model) {
- var parent,
- group,
- idx,
- length;
-
- for (idx = groups.length-1, length = 0; idx >= length; idx--) {
- group = groups[idx];
- parent = {
- value: model.get(group.field),
- field: group.field,
- items: parent ? [parent] : [model],
- hasSubgroups: !!parent,
- aggregates: {}
- };
- }
-
- return parent;
- }
-
function indexOfPristineModel(data, model) {
if (model) {
return indexOf(data, function(item) {
- if (item.uid) {
- return item.uid == model.uid;
- }
-
- return item[model.idField] === model.id;
+ return (item.uid && item.uid == model.uid) || (item[model.idField] === model.id && model.id !== model._defaultId);
});
}
return -1;
@@ -2222,7 +2243,7 @@ var A = 0;
Observable.fn.init.call(that);
- that.transport = Transport.create(options, data);
+ that.transport = Transport.create(options, data, that);
if (isFunction(that.transport.push)) {
that.transport.push({
@@ -2241,7 +2262,7 @@ var A = 0;
return JSON.parse(localStorage.getItem(key));
},
setItem: function(item) {
- localStorage.setItem(key, stringify(item));
+ localStorage.setItem(key, stringify(that.reader.serialize(item)));
}
};
} else {
@@ -2275,6 +2296,10 @@ var A = 0;
batch: false
},
+ clone: function() {
+ return this;
+ },
+
online: function(value) {
if (value !== undefined) {
if (this._online != value) {
@@ -2300,7 +2325,7 @@ var A = 0;
return this._storage.setItem(state);
}
- return this._storage.getItem() || {};
+ return this._storage.getItem() || [];
},
_isServerGrouped: function() {
@@ -2464,7 +2489,7 @@ var A = 0;
}
if (this._isServerGrouped()) {
- this._data.splice(index, 0, wrapInEmptyGroup(this.group(), model));
+ this._data.splice(index, 0, this._wrapInEmptyGroup(model));
} else {
this._data.splice(index, 0, model);
}
@@ -2492,7 +2517,7 @@ var A = 0;
var pristine = result.toJSON();
if (this._isServerGrouped()) {
- pristine = wrapInEmptyGroup(this.group(), pristine);
+ pristine = this._wrapInEmptyGroup(pristine);
}
this._pristineData.push(pristine);
@@ -2614,14 +2639,43 @@ var A = 0;
return model;
},
+ destroyed: function() {
+ return this._destroyed;
+ },
+
+ created: function() {
+ var idx,
+ length,
+ result = [],
+ data = this._flatData(this._data);
+
+ for (idx = 0, length = data.length; idx < length; idx++) {
+ if (data[idx].isNew && data[idx].isNew()) {
+ result.push(data[idx]);
+ }
+ }
+ return result;
+ },
+
+ updated: function() {
+ var idx,
+ length,
+ result = [],
+ data = this._flatData(this._data);
+
+ for (idx = 0, length = data.length; idx < length; idx++) {
+ if ((data[idx].isNew && !data[idx].isNew()) && data[idx].dirty) {
+ result.push(data[idx]);
+ }
+ }
+ return result;
+ },
+
sync: function() {
var that = this,
- idx,
- length,
created = [],
updated = [],
- destroyed = that._destroyed,
- data = that._flatData(that._data);
+ destroyed = that._destroyed;
var promise = $.Deferred().resolve().promise();
@@ -2631,18 +2685,18 @@ var A = 0;
return promise;
}
- for (idx = 0, length = data.length; idx < length; idx++) {
- if (data[idx].isNew()) {
- created.push(data[idx]);
- } else if (data[idx].dirty) {
- updated.push(data[idx]);
- }
- }
+ created = that.created();
+ updated = that.updated();
var promises = [];
- promises.push.apply(promises, that._send("create", created));
- promises.push.apply(promises, that._send("update", updated));
- promises.push.apply(promises, that._send("destroy", destroyed));
+
+ if (that.options.batch && that.transport.submit) {
+ promises = that._sendSubmit(created, updated, destroyed);
+ } else {
+ promises.push.apply(promises, that._send("create", created));
+ promises.push.apply(promises, that._send("update", updated));
+ promises.push.apply(promises, that._send("destroy", destroyed));
+ }
promise = $.when
.apply(null, promises)
@@ -2691,7 +2745,7 @@ var A = 0;
hasChanges: function() {
var idx,
length,
- data = this._data;
+ data = this._flatData(this._data);
if (this._destroyed.length) {
return true;
@@ -2743,7 +2797,7 @@ var A = 0;
models[idx].accept(response[idx]);
if (type === "create") {
- pristine.push(serverGroup ? wrapInEmptyGroup(that.group(), models[idx]) : response[idx]);
+ pristine.push(serverGroup ? that._wrapInEmptyGroup(models[idx]) : response[idx]);
} else if (type === "update") {
that._updatePristineForModel(models[idx], response[idx]);
}
@@ -2826,6 +2880,73 @@ var A = 0;
});
},
+ _submit: function(promises, data) {
+ var that = this;
+
+ that.trigger(REQUESTSTART, { type: "submit" });
+
+ that.transport.submit(extend({
+ success: function(response, type) {
+ var promise = $.grep(promises, function(x) {
+ return x.type == type;
+ })[0];
+
+ if (promise) {
+ promise.resolve({
+ response: response,
+ models: promise.models,
+ type: type
+ });
+ }
+ },
+ error: function(response, status, error) {
+ for (var idx = 0; idx < promises.length; idx++) {
+ promises[idx].reject(response);
+ }
+
+ that.error(response, status, error);
+ }
+ }, data));
+ },
+
+ _sendSubmit: function(created, updated, destroyed) {
+ var that = this,
+ promises = [];
+
+ if (that.options.batch) {
+ if (created.length) {
+ promises.push($.Deferred(function(deferred) {
+ deferred.type = "create";
+ deferred.models = created;
+ }));
+ }
+
+ if (updated.length) {
+ promises.push($.Deferred(function(deferred) {
+ deferred.type = "update";
+ deferred.models = updated;
+ }));
+ }
+
+ if (destroyed.length) {
+ promises.push($.Deferred(function(deferred) {
+ deferred.type = "destroy";
+ deferred.models = destroyed;
+ }));
+ }
+
+ that._submit(promises, {
+ data: {
+ created: that.reader.serialize(toJSON(created)),
+ updated: that.reader.serialize(toJSON(updated)),
+ destroyed: that.reader.serialize(toJSON(destroyed))
+ }
+ });
+ }
+
+ return promises;
+ },
+
_promise: function(data, models, type) {
var that = this;
@@ -2883,7 +3004,7 @@ var A = 0;
that.transport.read({
data: params,
success: function(data) {
- that.success(data);
+ that.success(data, params);
deferred.resolve();
},
@@ -2896,7 +3017,7 @@ var A = 0;
}
});
} else if (that.options.offlineStorage != null){
- that.success(that.offlineData());
+ that.success(that.offlineData(), params);
deferred.resolve();
}
@@ -2939,13 +3060,23 @@ var A = 0;
data = that._readData(data);
var items = [];
+ var itemIds = {};
+ var model = that.reader.model;
+ var idField = model ? model.idField : "id";
+ var idx;
- for (var idx = 0; idx < data.length; idx++) {
+ for (idx = 0; idx < this._destroyed.length; idx++) {
+ var id = this._destroyed[idx][idField];
+ itemIds[id] = id;
+ }
+
+ for (idx = 0; idx < data.length; idx++) {
var item = data[idx];
var state = item.__state__;
-
if (state == "destroy") {
- this._destroyed.push(this._createNewModel(item));
+ if (!itemIds[item[idField]]) {
+ this._destroyed.push(this._createNewModel(item));
+ }
} else {
items.push(item);
}
@@ -3027,13 +3158,15 @@ var A = 0;
if (this.options.offlineStorage != null) {
var state = items(this._data);
+ var destroyed = [];
+
for (var idx = 0; idx < this._destroyed.length; idx++) {
var item = this._destroyed[idx].toJSON();
item.__state__ = "destroy";
- state.push(item);
+ destroyed.push(item);
}
- this.offlineData(state);
+ this.offlineData(state.concat(destroyed));
if (updatePristine) {
this._pristineData = state;
@@ -3046,7 +3179,7 @@ var A = 0;
start = that._skip || 0,
end = start + that._flatData(data, true).length;
- that._ranges.push({ start: start, end: end, data: data });
+ that._ranges.push({ start: start, end: end, data: data, timestamp: new Date().getTime() });
that._ranges.sort( function(x, y) { return x.start - y.start; } );
},
@@ -3133,20 +3266,25 @@ var A = 0;
return false;
},
+ _shouldWrap: function(data) {
+ var model = this.reader.model;
+
+ if (model && data.length) {
+ return !(data[0] instanceof model);
+ }
+
+ return false;
+ },
+
_observe: function(data) {
var that = this,
- model = that.reader.model,
- wrap = false;
+ model = that.reader.model;
that._shouldDetachObservableParents = true;
- if (model && data.length) {
- wrap = !(data[0] instanceof model);
- }
-
if (data instanceof ObservableArray) {
that._shouldDetachObservableParents = false;
- if (wrap) {
+ if (that._shouldWrap(data)) {
data.type = that.reader.model;
data.wrapAll(data, data);
}
@@ -3169,6 +3307,27 @@ var A = 0;
return data.bind(CHANGE, that._changeHandler);
},
+ _updateTotalForAction: function(action, items) {
+ var that = this;
+
+ var total = parseInt(that._total, 10);
+
+ if (!isNumber(that._total)) {
+ total = parseInt(that._pristineTotal, 10);
+ }
+ if (action === "add") {
+ total += items.length;
+ } else if (action === "remove") {
+ total -= items.length;
+ } else if (action !== "itemchange" && action !== "sync" && !that.options.serverPaging) {
+ total = that._pristineTotal;
+ } else if (action === "sync") {
+ total = that._pristineTotal = parseInt(that._total, 10);
+ }
+
+ that._total = total;
+ },
+
_change: function(e) {
var that = this, idx, length, action = e ? e.action : "";
@@ -3181,23 +3340,20 @@ var A = 0;
}
if (that.options.autoSync && (action === "add" || action === "remove" || action === "itemchange")) {
+
+ var handler = function(args) {
+ if (args.action === "sync") {
+ that.unbind("change", handler);
+ that._updateTotalForAction(action, e.items);
+ }
+ };
+
+ that.first("change", handler);
+
that.sync();
- } else {
- var total = parseInt(that._total, 10);
- if (!isNumber(that._total)) {
- total = parseInt(that._pristineTotal, 10);
- }
- if (action === "add") {
- total += e.items.length;
- } else if (action === "remove") {
- total -= e.items.length;
- } else if (action !== "itemchange" && action !== "sync" && !that.options.serverPaging) {
- total = that._pristineTotal;
- } else if (action === "sync") {
- total = that._pristineTotal = parseInt(that._total, 10);
- }
- that._total = total;
+ } else {
+ that._updateTotalForAction(action, e ? e.items : []);
that._process(that._data, e);
}
@@ -3447,8 +3603,8 @@ var A = 0;
return that._filter;
}
- that._query({ filter: val, page: 1 });
that.trigger("reset");
+ that._query({ filter: val, page: 1 });
},
group: function(val) {
@@ -3478,7 +3634,53 @@ var A = 0;
},
aggregates: function() {
- return this._aggregateResult;
+ var result = this._aggregateResult;
+
+ if (isEmptyObject(result)) {
+ result = this._emptyAggregates(this.aggregate());
+ }
+
+ return result;
+ },
+
+ _emptyAggregates: function(aggregates) {
+ var result = {};
+
+ if (!isEmptyObject(aggregates)) {
+ var aggregate = {};
+
+ if (!isArray(aggregates)){
+ aggregates = [aggregates];
+ }
+
+ for (var idx = 0; idx = length; idx--) {
+ group = groups[idx];
+ parent = {
+ value: model.get(group.field),
+ field: group.field,
+ items: parent ? [parent] : [model],
+ hasSubgroups: !!parent,
+ aggregates: this._emptyAggregates(group.aggregates)
+ };
+ }
+
+ return parent;
},
totalPages: function() {
@@ -3513,7 +3715,14 @@ var A = 0;
this._skipRequestsInProgress = false;
},
+ _timeStamp: function() {
+ return new Date().getTime();
+ },
+
range: function(skip, take) {
+ this._currentRequestTimeStamp = this._timeStamp();
+ this._skipRequestsInProgress = true;
+
skip = math.min(skip || 0, this.total());
var that = this,
@@ -3521,12 +3730,10 @@ var A = 0;
size = math.min(pageSkip + take, that.total()),
data;
- that._skipRequestsInProgress = false;
-
data = that._findRange(skip, math.min(skip + take, that.total()));
if (data.length) {
- that._skipRequestsInProgress = true;
+
that._pending = undefined;
that._skip = skip > that.skip() ? math.min(size, (that.totalPages() - 1) * that.take()) : pageSkip;
@@ -3645,7 +3852,6 @@ var A = 0;
_mergeGroups: function(data, range, skip, take) {
if (this._isServerGrouped()) {
- //var temp = cloneGroups(range),
var temp = range.toJSON(),
prevGroup;
@@ -3675,10 +3881,11 @@ var A = 0;
_prefetchSuccessHandler: function (skip, size, callback, force) {
var that = this;
+ var timestamp = that._timeStamp();
return function(data) {
var found = false,
- range = { start: skip, end: size, data: [] },
+ range = { start: skip, end: size, data: [], timestamp: that._timeStamp() },
idx,
length,
temp;
@@ -3692,6 +3899,7 @@ var A = 0;
temp = that._readData(data);
if (temp.length) {
+
for (idx = 0, length = that._ranges.length; idx < length; idx++) {
if (that._ranges[idx].start === skip) {
found = true;
@@ -3709,7 +3917,7 @@ var A = 0;
that._ranges.sort( function(x, y) { return x.start - y.start; } );
that._total = that.reader.total(data);
- if (force || !that._skipRequestsInProgress) {
+ if (force || (timestamp >= that._currentRequestTimeStamp || !that._skipRequestsInProgress)) {
if (callback && temp.length) {
callback();
} else {
@@ -3741,7 +3949,11 @@ var A = 0;
if (!that.trigger(REQUESTSTART, { type: "read" })) {
that.transport.read({
data: that._params(options),
- success: that._prefetchSuccessHandler(skip, size, callback)
+ success: that._prefetchSuccessHandler(skip, size, callback),
+ error: function() {
+ var args = slice.call(arguments);
+ that.error.apply(that, args);
+ }
});
} else {
that._dequeueRequest();
@@ -3832,13 +4044,17 @@ var A = 0;
var Transport = {};
- Transport.create = function(options, data) {
+ Transport.create = function(options, data, dataSource) {
var transport,
- transportOptions = options.transport;
+ transportOptions = options.transport ? $.extend({}, options.transport) : null;
if (transportOptions) {
transportOptions.read = typeof transportOptions.read === STRING ? { url: transportOptions.read } : transportOptions.read;
+ if (options.type === "jsdo") {
+ transportOptions.dataSource = dataSource;
+ }
+
if (options.type) {
kendo.data.transports = kendo.data.transports || {};
kendo.data.schemas = kendo.data.schemas || {};
@@ -3881,6 +4097,10 @@ var A = 0;
data = inferTable(table, fields);
} else if (select) {
data = inferSelect(select, fields);
+
+ if (dataSource.group === undefined && data[0] && data[0].optgroup !== undefined) {
+ dataSource.group = "optgroup";
+ }
}
}
@@ -3898,6 +4118,9 @@ var A = 0;
}
dataSource.data = data;
+
+ select = null;
+ dataSource.select = null;
table = null;
dataSource.table = null;
@@ -3905,24 +4128,35 @@ var A = 0;
};
function inferSelect(select, fields) {
- var options = $(select)[0].children,
- idx,
- length,
- data = [],
- record,
- firstField = fields[0],
- secondField = fields[1],
- value,
- option;
+ select = $(select)[0];
+ var options = select.options;
+ var firstField = fields[0];
+ var secondField = fields[1];
+
+ var data = [];
+ var idx, length;
+ var optgroup;
+ var option;
+ var record;
+ var value;
for (idx = 0, length = options.length; idx < length; idx++) {
record = {};
option = options[idx];
+ optgroup = option.parentNode;
+
+ if (optgroup === select) {
+ optgroup = null;
+ }
- if (option.disabled) {
+ if (option.disabled || (optgroup && optgroup.disabled)) {
continue;
}
+ if (optgroup) {
+ record.optgroup = optgroup.label;
+ }
+
record[firstField.field] = option.text;
value = option.attributes.value;
@@ -4217,7 +4451,12 @@ var A = 0;
},
_find: function(method, value) {
- var idx, length, node, data, children;
+ var idx, length, node, children;
+ var data = this._data;
+
+ if (!data) {
+ return;
+ }
node = DataSource.fn[method].call(this, value);
@@ -4227,10 +4466,6 @@ var A = 0;
data = this._flatData(this._data);
- if (!data) {
- return;
- }
-
for (idx = 0, length = data.length; idx < length; idx++) {
children = data[idx].children;
@@ -4374,9 +4609,7 @@ var A = 0;
at: function(index) {
var pageSize = this.pageSize,
- item,
- itemPresent = true,
- changeTo;
+ itemPresent = true;
if (index >= this.total()) {
this.trigger("endreached", {index: index });
diff --git a/vendor/kendo/kendo.data.odata.js b/vendor/kendo/kendo.data.odata.js
index eda9202..2b400b6 100644
--- a/vendor/kendo/kendo.data.odata.js
+++ b/vendor/kendo/kendo.data.odata.js
@@ -41,7 +41,10 @@
page: $.noop,
filter: function(params, filter, useVersionFour) {
if (filter) {
- params.$filter = toOdataFilter(filter, useVersionFour);
+ filter = toOdataFilter(filter, useVersionFour);
+ if (filter) {
+ params.$filter = filter;
+ }
}
},
sort: function(params, orderby) {
diff --git a/vendor/kendo/kendo.data.xml.js b/vendor/kendo/kendo.data.xml.js
index 202b8e8..faaf35a 100644
--- a/vendor/kendo/kendo.data.xml.js
+++ b/vendor/kendo/kendo.data.xml.js
@@ -46,7 +46,9 @@
if (model.fields) {
each(model.fields, function(field, value) {
if (isPlainObject(value) && value.field) {
- value = extend(value, { field: that.getter(value.field) });
+ if (!$.isFunction(value.field)) {
+ value = extend(value, { field: that.getter(value.field) });
+ }
} else {
value = { field: that.getter(value) };
}
diff --git a/vendor/kendo/kendo.datepicker.js b/vendor/kendo/kendo.datepicker.js
index 89f1c1b..5f90f72 100644
--- a/vendor/kendo/kendo.datepicker.js
+++ b/vendor/kendo/kendo.datepicker.js
@@ -14,22 +14,6 @@
* limitations under the License.
*/
-/**
- * Copyright 2015 Telerik AD
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
(function(f, define){
define([ "./kendo.calendar", "./kendo.popup" ], f);
})(function(){
@@ -49,7 +33,6 @@
OPEN = "open",
CLOSE = "close",
CHANGE = "change",
- DATEVIEW = "dateView",
DISABLED = "disabled",
READONLY = "readonly",
DEFAULT = "k-state-default",
@@ -57,7 +40,6 @@
SELECTED = "k-state-selected",
STATEDISABLED = "k-state-disabled",
HOVER = "k-state-hover",
- KEYDOWN = "keydown" + ns,
HOVEREVENTS = "mouseenter" + ns + " mouseleave" + ns,
MOUSEDOWN = "mousedown" + ns,
ID = "id",
@@ -82,7 +64,13 @@
calendar.normalize(options);
+
parseFormats = $.isArray(parseFormats) ? parseFormats : [parseFormats];
+
+ if (!parseFormats.length) {
+ parseFormats.push("yyyy-MM-dd");
+ }
+
if ($.inArray(format, parseFormats) === -1) {
parseFormats.splice(0, 0, options.format);
}
@@ -204,35 +192,33 @@
var that = this,
key = e.keyCode,
calendar = that.calendar,
- selectIsClicked = e.ctrlKey && key == keys.DOWN || key == keys.ENTER;
-
- if (key == keys.ESC) {
- that.close();
- return;
- }
+ selectIsClicked = e.ctrlKey && key == keys.DOWN || key == keys.ENTER,
+ handled = false;
if (e.altKey) {
if (key == keys.DOWN) {
that.open();
e.preventDefault();
+ handled = true;
} else if (key == keys.UP) {
that.close();
e.preventDefault();
+ handled = true;
}
- return;
- }
- if (!that.popup.visible()){
- return;
- }
+ } else if (that.popup.visible()) {
- if (selectIsClicked && calendar._cell.hasClass(SELECTED)) {
- that.close();
- e.preventDefault();
- return;
+ if (key == keys.ESC || (selectIsClicked && calendar._cell.hasClass(SELECTED))) {
+ that.close();
+ e.preventDefault();
+ return true;
+ }
+
+ that._current = calendar._move(e);
+ handled = true;
}
- that._current = calendar._move(e);
+ return handled;
},
current: function(date) {
@@ -290,6 +276,8 @@
normalize(options);
+ that._initialOptions = extend({}, options);
+
that._wrapper();
that.dateView = new DateView(extend({}, options, {
@@ -350,7 +338,7 @@
that._reset();
that._template();
- disabled = element.is("[disabled]");
+ disabled = element.is("[disabled]") || $(that.element).parents("fieldset").is(':disabled');
if (disabled) {
that.enable(false);
} else {
@@ -540,23 +528,32 @@
that._old = value;
that._oldText = that.element.val();
- // trigger the DOM change event so any subscriber gets notified
- that.element.trigger(CHANGE);
+ if (!that._typing) {
+ // trigger the DOM change event so any subscriber gets notified
+ that.element.trigger(CHANGE);
+ }
that.trigger(CHANGE);
}
+
+ that._typing = false;
},
_keydown: function(e) {
var that = this,
dateView = that.dateView,
- value = that.element.val();
+ value = that.element.val(),
+ handled = false;
if (!dateView.popup.visible() && e.keyCode == keys.ENTER && value !== that._oldText) {
that._change(value);
} else {
- dateView.move(e);
+ handled = dateView.move(e);
that._updateARIA(dateView._current);
+
+ if (!handled) {
+ that._typing = true;
+ }
}
},
@@ -662,6 +659,8 @@
if (form[0]) {
that._resetHandler = function() {
that.value(element[0].defaultValue);
+ that.max(that._initialOptions.max);
+ that.min(that._initialOptions.min);
};
that._form = form.on("reset", that._resetHandler);
diff --git a/vendor/kendo/kendo.editable.js b/vendor/kendo/kendo.editable.js
index 4d7d03a..2ff339d 100644
--- a/vendor/kendo/kendo.editable.js
+++ b/vendor/kendo/kendo.editable.js
@@ -139,8 +139,9 @@
},
"values": function(container, options) {
var attr = createAttributes(options);
+ var items = kendo.stringify(convertItems(options.values));
$('') .attr(attr).appendTo(container);
$('').hide().appendTo(container);
}
@@ -217,19 +218,18 @@
values = {},
bindAttribute = kendo.attr("bind"),
fieldName = e.field.replace(nameSpecialCharRegExp, "\\$1"),
- checkedBinding = 'checked:' + fieldName,
- valueBinding = 'value:' + fieldName;
+ bindingRegex = new RegExp("(value|checked)\\s*:\\s*" + fieldName + "\\s*(,|$)");
values[e.field] = e.value;
- input = $(':input[' + bindAttribute + '*="' + valueBinding + '"],:input[' + bindAttribute + '*="' + checkedBinding + '"]', that.element)
- .filter("[" + kendo.attr("validate") + "!='false']");
+ input = $(':input[' + bindAttribute + '*="' + fieldName + '"]', that.element)
+ .filter("[" + kendo.attr("validate") + "!='false']").filter(function() {
+ return bindingRegex.test($(this).attr(bindAttribute));
+ });
if (input.length > 1) {
input = input.filter(function () {
var element = $(this);
- var bindings = element.attr(bindAttribute).split(",");
- var matchesBinding = inArray(valueBinding, bindings) >= 0 || inArray(checkedBinding, bindings) >= 0;
- return matchesBinding && (!element.is(":radio") || element.val() == value);
+ return !element.is(":radio") || element.val() == value;
});
}
@@ -303,7 +303,7 @@
that.angular("compile", function(){
return {
elements: container,
- data: [ { dataItem: model } ]
+ data: container.map(function() { return { dataItem: model }; })
};
});
}
diff --git a/vendor/kendo/kendo.listview.js b/vendor/kendo/kendo.listview.js
index ba09db6..3156233 100644
--- a/vendor/kendo/kendo.listview.js
+++ b/vendor/kendo/kendo.listview.js
@@ -32,7 +32,6 @@
FOCUSED = "k-state-focused",
SELECTED = "k-state-selected",
KEDITITEM = "k-edit-item",
- STRING = "string",
EDIT = "edit",
REMOVE = "remove",
SAVE = "save",
@@ -521,48 +520,40 @@
return this.dataSource.getByUid(uid);
},
- _closeEditable: function(validate) {
+ _closeEditable: function() {
var that = this,
editable = that.editable,
data,
item,
index,
- template = that.template,
- valid = true;
+ template = that.template;
if (editable) {
- if (validate) {
- valid = editable.end();
+ if (editable.element.index() % 2) {
+ template = that.altTemplate;
}
- if (valid) {
- if (editable.element.index() % 2) {
- template = that.altTemplate;
- }
+ that.angular("cleanup", function() {
+ return { elements: [ editable.element ]};
+ });
- that.angular("cleanup", function() {
- return { elements: [ editable.element ]};
- });
+ data = that._modelFromElement(editable.element);
+ that._destroyEditable();
- data = that._modelFromElement(editable.element);
- that._destroyEditable();
+ index = editable.element.index();
+ editable.element.replaceWith(template(data));
+ item = that.items().eq(index);
+ item.attr(kendo.attr("uid"), data.uid);
- index = editable.element.index();
- editable.element.replaceWith(template(data));
- item = that.items().eq(index);
- item.attr(kendo.attr("uid"), data.uid);
-
- if (that._hasBindingTarget()) {
- kendo.bind(item, data);
- }
-
- that.angular("compile", function() {
- return { elements: [ item ], data: [ { dataItem: data } ]};
- });
+ if (that._hasBindingTarget()) {
+ kendo.bind(item, data);
}
- }
- return valid;
+ that.angular("compile", function() {
+ return { elements: [ item ], data: [ { dataItem: data } ]};
+ });
+ }
+ return true;
},
edit: function(item) {
@@ -597,10 +588,11 @@
return;
}
- editable = editable.element;
- model = that._modelFromElement(editable);
+ var container = editable.element;
+ model = that._modelFromElement(container);
- if (!that.trigger(SAVE, { model: model, item: editable }) && that._closeEditable(true)) {
+ if (editable.end() && !that.trigger(SAVE, { model: model, item: container })) {
+ that._closeEditable();
that.dataSource.sync();
}
},
@@ -612,7 +604,7 @@
if (that.editable) {
dataSource.cancelChanges(that._modelFromElement(that.editable.element));
- that._closeEditable(false);
+ that._closeEditable();
}
if (!that.trigger(REMOVE, { model: data, item: item })) {
@@ -624,6 +616,7 @@
add: function() {
var that = this,
+ dataItem,
dataSource = that.dataSource,
index = dataSource.indexOf((dataSource.view() || [])[0]);
@@ -632,8 +625,8 @@
}
that.cancel();
- dataSource.insert(index, {});
- that.edit(that.element.children().first());
+ dataItem = dataSource.insert(index, {});
+ that.edit(that.element.find("[data-uid='" + dataItem.uid + "']"));
},
cancel: function() {
@@ -646,7 +639,7 @@
if (!that.trigger(CANCEL, { model: model, container: container})) {
dataSource.cancelChanges(model);
- that._closeEditable(false);
+ that._closeEditable();
}
}
},
diff --git a/vendor/kendo/kendo.numerictextbox.js b/vendor/kendo/kendo.numerictextbox.js
index e449405..39b5a21 100644
--- a/vendor/kendo/kendo.numerictextbox.js
+++ b/vendor/kendo/kendo.numerictextbox.js
@@ -50,7 +50,8 @@
ARIA_READONLY = "aria-readonly",
INTEGER_REGEXP = /^(-)?(\d*)$/,
NULL = null,
- proxy = $.proxy;
+ proxy = $.proxy,
+ extend = $.extend;
var NumericTextBox = Widget.extend({
init: function(element, options) {
@@ -67,6 +68,8 @@
options.placeholder = options.placeholder || element.attr("placeholder");
+ that._initialOptions = extend({}, options);
+
that._reset();
that._wrapper();
that._arrows();
@@ -75,7 +78,7 @@
if (!kendo.support.mobileOS) {
that._text.on(FOCUS + ns, proxy(that._click, that));
} else {
- that._text.on(TOUCHEND + ns + " " + FOCUS + ns, function(e) {
+ that._text.on(TOUCHEND + ns + " " + FOCUS + ns, function() {
that._toggleText(false);
element.focus();
});
@@ -105,7 +108,8 @@
value = options.value;
that.value(value !== NULL ? value : element.val());
- disabled = element.is("[disabled]");
+ disabled = element.is("[disabled]") || $(that.element).parents("fieldset").is(':disabled');
+
if (disabled) {
that.enable(false);
} else {
@@ -358,11 +362,15 @@
if (that._old != value) {
that._old = value;
- // trigger the DOM change event so any subscriber gets notified
- that.element.trigger(CHANGE);
+ if (!that._typing) {
+ // trigger the DOM change event so any subscriber gets notified
+ that.element.trigger(CHANGE);
+ }
that.trigger(CHANGE);
}
+
+ that._typing = false;
},
_culture: function(culture) {
@@ -420,6 +428,7 @@
text[0].tabIndex = element.tabIndex;
text[0].style.cssText = element.style.cssText;
+ text[0].title = element.title;
text.prop("placeholder", that.options.placeholder);
if (accessKey) {
@@ -442,7 +451,10 @@
that._step(1);
} else if (key == keys.ENTER) {
that._change(that.element.val());
+ } else {
+ that._typing = true;
}
+
},
_keypress: function(e) {
@@ -563,6 +575,7 @@
value += that.options.step * step;
that._update(that._adjust(value));
+ that._typing = false;
that.trigger(SPIN);
},
@@ -658,6 +671,8 @@
that._resetHandler = function() {
setTimeout(function() {
that.value(element[0].value);
+ that.max(that._initialOptions.max);
+ that.min(that._initialOptions.min);
});
};
diff --git a/vendor/kendo/kendo.pager.js b/vendor/kendo/kendo.pager.js
index 8f59ba8..860aea4 100644
--- a/vendor/kendo/kendo.pager.js
+++ b/vendor/kendo/kendo.pager.js
@@ -145,13 +145,18 @@
if (options.pageSizes){
if (!that.element.find(".k-pager-sizes").length){
- $('")
+ var pageSizes = options.pageSizes.length ? options.pageSizes : ["all", 5, 10, 20];
+ var pageItems = $.map(pageSizes, function(size) {
+ if (size.toLowerCase && size.toLowerCase() === "all") {
+ return "";
+ }
+
+ return "";
+ });
+
+ $('")
.appendTo(that.element)
- .find("select")
- .html($.map($.isArray(options.pageSizes) ? options.pageSizes : [5,10,20], function(page){
- return "";
- }).join(""))
- .end()
+ .find("select").html(pageItems.join("")).end()
.appendTo(that.element);
}
@@ -181,7 +186,7 @@
that.element
.on(CLICK + NS , "a", proxy(that._click, that))
- .addClass("k-pager-wrap k-widget");
+ .addClass("k-pager-wrap k-widget k-floatwrap");
that.element.on(CLICK + NS , ".k-current-page", proxy(that._toggleActive, that));
@@ -223,6 +228,7 @@
pageSizes: false,
refresh: false,
messages: {
+ allPages: "All",
display: "{0} - {1} of {2} items",
empty: "No items to display",
page: "Page",
@@ -335,12 +341,20 @@
}
if (options.pageSizes) {
+ var hasAll = that.element.find(".k-pager-sizes option[value='all']").length > 0;
+ var selectAll = hasAll && pageSize === this.dataSource.total();
+ var text = pageSize;
+ if (selectAll) {
+ pageSize = "all";
+ text = options.messages.allPages;
+ }
+
that.element
.find(".k-pager-sizes select")
.val(pageSize)
.filter("[" + kendo.attr("role") + "=dropdownlist]")
.kendoDropDownList("value", pageSize)
- .kendoDropDownList("text", pageSize); // handles custom values
+ .kendoDropDownList("text", text); // handles custom values
}
},
@@ -366,14 +380,18 @@
},
_change: function(e) {
- var pageSize = parseInt(e.currentTarget.value, 10);
+ var value = e.currentTarget.value;
+ var pageSize = parseInt(value, 10);
+ var dataSource = this.dataSource;
if (!isNaN(pageSize)){
- this.dataSource.pageSize(pageSize);
+ dataSource.pageSize(pageSize);
+ } else if ((value + "").toLowerCase() == "all") {
+ dataSource.pageSize(dataSource.total());
}
},
- _toggleActive: function(e) {
+ _toggleActive: function() {
this.list.toggleClass("k-state-expanded");
},
@@ -388,7 +406,7 @@
},
totalPages: function() {
- return Math.ceil((this.dataSource.total() || 0) / this.pageSize());
+ return Math.ceil((this.dataSource.total() || 0) / (this.pageSize() || 1));
},
pageSize: function() {
diff --git a/vendor/kendo/kendo.popup.js b/vendor/kendo/kendo.popup.js
index e7e868f..6730ec7 100644
--- a/vendor/kendo/kendo.popup.js
+++ b/vendor/kendo/kendo.popup.js
@@ -24,7 +24,6 @@
Widget = ui.Widget,
support = kendo.support,
getOffset = kendo.getOffset,
- activeElement = kendo._activeElement,
OPEN = "open",
CLOSE = "close",
DEACTIVATE = "deactivate",
@@ -217,8 +216,7 @@
if (!options.modal) {
DOCUMENT_ELEMENT.unbind(that.downEvent, that._mousedownProxy);
- that._scrollableParents().unbind(SCROLL, that._resizeProxy);
- WINDOW.unbind(RESIZE_SCROLL, that._resizeProxy);
+ that._toggleResize(false);
}
kendo.destroy(that.element.children());
@@ -266,11 +264,8 @@
// this binding hangs iOS in editor
if (!(support.mobileOS.ios || support.mobileOS.android)) {
// all elements in IE7/8 fire resize event, causing mayhem
- that._scrollableParents()
- .unbind(SCROLL, that._resizeProxy)
- .bind(SCROLL, that._resizeProxy);
- WINDOW.unbind(RESIZE_SCROLL, that._resizeProxy)
- .bind(RESIZE_SCROLL, that._resizeProxy);
+ that._toggleResize(false);
+ that._toggleResize(true);
}
}
@@ -315,6 +310,12 @@
}
},
+ position: function() {
+ if (this.visible()) {
+ this._position();
+ }
+ },
+
toggle: function() {
var that = this;
@@ -333,7 +334,10 @@
if (that.visible()) {
wrap = (that.wrapper[0] ? that.wrapper : kendo.wrap(that.element).hide());
+ that._toggleResize(false);
+
if (that._closing || that._trigger(CLOSE)) {
+ that._toggleResize(true);
return;
}
@@ -348,8 +352,6 @@
});
DOCUMENT_ELEMENT.unbind(that.downEvent, that._mousedownProxy);
- that._scrollableParents().unbind(SCROLL, that._resizeProxy);
- WINDOW.unbind(RESIZE_SCROLL, that._resizeProxy);
if (skipEffects) {
animation = { hide: true, effects: {} };
@@ -392,6 +394,13 @@
}
},
+ _toggleResize: function(toggle) {
+ var method = toggle ? "on" : "off";
+
+ this._scrollableParents()[method](SCROLL, this._resizeProxy);
+ WINDOW[method](RESIZE_SCROLL, this._resizeProxy);
+ },
+
_mousedown: function(e) {
var that = this,
container = that.element[0],
@@ -451,14 +460,14 @@
return $(this.options.anchor)
.parentsUntil("body")
.filter(function(index, element) {
- var computedStyle = kendo.getComputedStyles(element, ["overflow"]);
- return computedStyle.overflow != "visible";
+ return kendo.isScrollable(element);
});
},
_position: function(fixed) {
var that = this,
- element = that.element.css(POSITION, ""),
+ //element = that.element.css(POSITION, ""), /* fixes telerik/kendo-ui-core#790, comes from telerik/kendo#615 */
+ element = that.element,
wrapper = that.wrapper,
options = that.options,
viewport = $(options.viewport),
@@ -471,12 +480,18 @@
siblingContainer, parents,
parentZIndex, zIndex = 10002,
isWindow = !!((viewport[0] == window) && window.innerWidth && (zoomLevel <= 1.02)),
- idx = 0, length, viewportWidth, viewportHeight;
+ idx = 0,
+ docEl = document.documentElement,
+ length, viewportWidth, viewportHeight;
// $(window).height() uses documentElement to get the height
viewportWidth = isWindow ? window.innerWidth : viewport.width();
viewportHeight = isWindow ? window.innerHeight : viewport.height();
+ if (isWindow && docEl.scrollHeight - docEl.clientHeight > 0) {
+ viewportWidth -= kendo.support.scrollbar();
+ }
+
siblingContainer = anchor.parents().filter(wrapper.siblings());
if (siblingContainer[0]) {
diff --git a/vendor/kendo/kendo.selectable.js b/vendor/kendo/kendo.selectable.js
index eb96bd3..77f1f0a 100644
--- a/vendor/kendo/kendo.selectable.js
+++ b/vendor/kendo/kendo.selectable.js
@@ -23,7 +23,6 @@
Widget = kendo.ui.Widget,
proxy = $.proxy,
abs = Math.abs,
- shift = Array.prototype.shift,
ARIASELECTED = "aria-selected",
SELECTED = "k-state-selected",
ACTIVE = "k-state-selecting",
@@ -31,7 +30,7 @@
CHANGE = "change",
NS = ".kendoSelectable",
UNSELECTING = "k-state-unselecting",
- INPUTSELECTOR = "input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",
+ INPUTSELECTOR = "input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",
msie = kendo.support.browser.msie,
supportEventDelegation = false;
diff --git a/vendor/kendo/kendo.ui.core.js b/vendor/kendo/kendo.ui.core.js
index dd68e3e..93e8380 100644
--- a/vendor/kendo/kendo.ui.core.js
+++ b/vendor/kendo/kendo.ui.core.js
@@ -48,7 +48,7 @@
slice = [].slice,
globalize = window.Globalize;
- kendo.version = "2015.1.318 custom";
+ kendo.version = "$KENDO_VERSION";
function Class() {}
@@ -496,6 +496,8 @@ function pad(number, digits, end) {
symbol: "%"
},
currency: {
+ name: "US Dollar",
+ abbr: "USD",
pattern: ["($n)", "$n"],
decimals: 2,
",": ",",
@@ -1196,6 +1198,8 @@ function pad(number, digits, end) {
var i = 0,
length = names.length,
name, nameLength,
+ matchLength = 0,
+ matchIdx = 0,
subValue;
for (; i < length; i++) {
@@ -1207,11 +1211,17 @@ function pad(number, digits, end) {
subValue = subValue.toLowerCase();
}
- if (subValue == name) {
- valueIdx += nameLength;
- return i + 1;
+ if (subValue == name && nameLength > matchLength) {
+ matchLength = nameLength;
+ matchIdx = i;
}
}
+
+ if (matchLength) {
+ valueIdx += matchLength;
+ return matchIdx + 1;
+ }
+
return null;
},
checkLiteral = function() {
@@ -1271,6 +1281,10 @@ function pad(number, digits, end) {
calendar._lowerDays = lowerLocalInfo(calendar.days);
}
+ if (day !== null && count > 2) {
+ continue;
+ }
+
day = count < 3 ? getNumber(2) : getIndexByName(calendar._lowerDays[count == 3 ? "namesAbbr" : "names"], true);
if (day === null || outOfRange(day, 1, 31)) {
@@ -1480,7 +1494,6 @@ function pad(number, digits, end) {
var date = null;
var length, patterns;
var tzoffset;
- var sign;
if (value && value.indexOf("/D") === 0) {
date = dateRegExp.exec(value);
@@ -1843,6 +1856,38 @@ function pad(number, digits, end) {
return styles;
}
+ function isScrollable(element) {
+ if (element.className.indexOf("k-auto-scrollable") > -1) {
+ return true;
+ }
+
+ var overflow = getComputedStyles(element, ["overflow"]).overflow;
+ return overflow == "auto" || overflow == "scroll";
+ }
+
+ function scrollLeft(element, value) {
+ var el = element instanceof $ ? element[0] : element;
+ var isRtl = support.isRtl(element);
+ var webkit = support.browser.webkit;
+ var mozila = support.browser.mozilla;
+
+ if (value !== undefined) {
+ if (isRtl && webkit) {
+ el.scrollLeft = el.scrollWidth - el.clientWidth - value;
+ } else if (isRtl && mozila) {
+ el.scrollLeft = -value;
+ } else {
+ el.scrollLeft = value;
+ }
+ } else {
+ if (isRtl && webkit) {
+ return el.scrollWidth - el.clientWidth - el.scrollLeft;
+ } else {
+ return Math.abs(el.scrollLeft);
+ }
+ }
+ }
+
(function () {
support._scrollbar = undefined;
@@ -2014,6 +2059,7 @@ function pad(number, digits, end) {
support.detectBrowser = function(ua) {
var browser = false, match = [],
browserRxs = {
+ edge: /(edge)[ \/]([\w.]+)/i,
webkit: /(chrome)[ \/]([\w.]+)/i,
safari: /(webkit)[ \/]([\w.]+)/i,
opera: /(opera)(?:.*version|)[ \/]([\w.]+)/i,
@@ -2042,8 +2088,16 @@ function pad(number, digits, end) {
support.zoomLevel = function() {
try {
- return support.touch ? (document.documentElement.clientWidth / window.innerWidth) :
- support.browser.msie && support.browser.version >= 10 ? ((top || window).document.documentElement.offsetWidth / (top || window).innerWidth) : 1;
+ var browser = support.browser;
+ var ie11WidthCorrection = 0;
+ var docEl = document.documentElement;
+
+ if (browser.msie && browser.version == 11 && docEl.scrollHeight > docEl.clientHeight && !support.touch) {
+ ie11WidthCorrection = support.scrollbar();
+ }
+
+ return support.touch ? (docEl.clientWidth / window.innerWidth) :
+ browser.msie && browser.version >= 10 ? (((top || window).document.documentElement.offsetWidth + ie11WidthCorrection) / (top || window).innerWidth) : 1;
} catch(e) {
return 1;
}
@@ -2067,6 +2121,8 @@ function pad(number, digits, end) {
cssClass = "webkit";
} else if (browser.opera) {
cssClass = "opera";
+ } else if (browser.edge) {
+ cssClass = "edge";
}
if (cssClass) {
@@ -2156,6 +2212,8 @@ function pad(number, digits, end) {
var documentMode = document.documentMode;
support.hashChange = ("onhashchange" in window) && !(support.browser.msie && (!documentMode || documentMode <= 8)); // old IE detection
+
+ support.customElements = ("registerElement" in window.document);
})();
@@ -2175,8 +2233,7 @@ function pad(number, digits, end) {
type = "offset";
}
- var result = element[type](),
- mobileOS = support.mobileOS;
+ var result = element[type]();
// IE10 touch zoom is living in a separate viewport
if (support.browser.msie && (support.pointers || support.msPointers) && !positioned) {
@@ -2442,12 +2499,16 @@ function pad(number, digits, end) {
localUrlRe = /^([a-z]+:)?\/\//i;
extend(kendo, {
+ widgets: [],
+ _widgetRegisteredCallbacks: [],
ui: kendo.ui || {},
fx: kendo.fx || fx,
effects: kendo.effects || effects,
mobile: kendo.mobile || { },
data: kendo.data || {},
dataviz: kendo.dataviz || {},
+ drawing: kendo.drawing || {},
+ spreadsheet: {},
keys: {
INSERT: 45,
DELETE: 46,
@@ -2481,6 +2542,9 @@ function pad(number, digits, end) {
wrap: wrap,
deepExtend: deepExtend,
getComputedStyles: getComputedStyles,
+ webComponents: [],
+ isScrollable: isScrollable,
+ scrollLeft: scrollLeft,
size: size,
toCamelCase: toCamelCase,
toHyphens: toHyphens,
@@ -2515,7 +2579,10 @@ function pad(number, digits, end) {
}
if (safe) {
+ expression = expression.replace(/"([^.]*)\.([^"]*)"/g,'"$1_$DOT$_$2"');
+ expression = expression.replace(/'([^.]*)\.([^']*)'/g,"'$1_$DOT$_$2'");
expression = wrapExpression(expression.split("."), paramName);
+ expression = expression.replace(/_\$DOT\$_/g, ".");
} else {
expression = paramName + expression;
}
@@ -2576,6 +2643,14 @@ function pad(number, digits, end) {
return (/^(label|input|textarea|select)$/i).test(e.target.tagName);
},
+ onWidgetRegistered: function(callback) {
+ for (var i = 0, len = kendo.widgets.length; i < len; i++) {
+ callback(kendo.widgets[i]);
+ }
+
+ kendo._widgetRegisteredCallbacks.push(callback);
+ },
+
logToConsole: function(message) {
var console = window.console;
@@ -2664,9 +2739,9 @@ function pad(number, digits, end) {
var size = this.getSize(),
currentSize = this._size;
- if (force || !currentSize || size.width !== currentSize.width || size.height !== currentSize.height) {
+ if (force || (size.width > 0 || size.height > 0) && (!currentSize || size.width !== currentSize.width || size.height !== currentSize.height)) {
this._size = size;
- this._resize(size);
+ this._resize(size, force);
this.trigger("resize", size);
}
},
@@ -2693,8 +2768,18 @@ function pad(number, digits, end) {
that.element.removeData("handler");
that.unbind();
},
+ _destroy: function() {
+ this.destroy();
+ },
+ angular: function(){},
+
+ _muteAngularRebind: function(callback) {
+ this._muteRebind = true;
- angular: function(){}
+ callback.call(this);
+
+ this._muteRebind = false;
+ }
});
var DataBoundWidget = Widget.extend({
@@ -2984,6 +3069,13 @@ function pad(number, digits, end) {
getter = "getKendo" + prefix + name;
name = "kendo" + prefix + name;
+ var widgetEntry = { name: name, widget: widget, prefix: prefix || "" };
+ kendo.widgets.push(widgetEntry);
+
+ for (var i = 0, len = kendo._widgetRegisteredCallbacks.length; i < len; i++) {
+ kendo._widgetRegisteredCallbacks[i](widgetEntry);
+ }
+
$.fn[name] = function(options) {
var value = this,
args;
@@ -3015,7 +3107,7 @@ function pad(number, digits, end) {
});
} else {
this.each(function() {
- new widget(this, options);
+ return new widget(this, options);
});
}
@@ -3105,6 +3197,10 @@ function pad(number, digits, end) {
kendo.touchScroller = function(elements, options) {
// return the first touch scroller
+ if (!options){ options = {}; }
+
+ options.useNative = true;
+
return $(elements).map(function(idx, element) {
element = $(element);
if (support.kineticScrollNeeded && kendo.mobile.ui.Scroller && !element.data("kendoMobileScroller")) {
@@ -3200,9 +3296,10 @@ function pad(number, digits, end) {
}
function visible(element) {
- return !$(element).parents().addBack().filter(function() {
- return $.css(this,"visibility") === "hidden" || $.expr.filters.hidden(this);
- }).length;
+ return $.expr.filters.visible(element) &&
+ !$(element).parents().addBack().filter(function() {
+ return $.css(this,"visibility") === "hidden";
+ }).length;
}
$.extend($.expr[ ":" ], {
@@ -3886,7 +3983,9 @@ function pad(number, digits, end) {
};
kendo.elementUnderCursor = function(e) {
- return document.elementFromPoint(e.x.client, e.y.client);
+ if (typeof e.x.client != "undefined") {
+ return document.elementFromPoint(e.x.client, e.y.client);
+ }
};
kendo.wheelDeltaY = function(jQueryEvent) {
@@ -4003,16 +4102,12 @@ function pad(number, digits, end) {
return start;
};
- kendo.compileMobileDirective = function(element, scopeSetup) {
+ kendo.compileMobileDirective = function(element, scope) {
var angular = window.angular;
element.attr("data-" + kendo.ns + "role", element[0].tagName.toLowerCase().replace('kendo-mobile-', '').replace('-', ''));
angular.element(element).injector().invoke(["$compile", function($compile) {
- var scope = angular.element(element).scope();
- if (scopeSetup) {
- scopeSetup(scope);
- }
$compile(element)(scope);
if (!/^\$(digest|apply)$/.test(scope.$$phase)) {
@@ -4039,6 +4134,35 @@ function pad(number, digits, end) {
return tokens;
};
+ kendo.cycleForm = function(form) {
+ var firstElement = form.find("input, .k-widget").first();
+ var lastElement = form.find("button, .k-button").last();
+
+ function focus(el) {
+ var widget = kendo.widgetInstance(el);
+
+ if (widget && widget.focus) {
+ widget.focus();
+ } else {
+ el.focus();
+ }
+ }
+
+ lastElement.on("keydown", function(e) {
+ if (e.keyCode == kendo.keys.TAB && !e.shiftKey) {
+ e.preventDefault();
+ focus(firstElement);
+ }
+ });
+
+ firstElement.on("keydown", function(e) {
+ if (e.keyCode == kendo.keys.TAB && e.shiftKey) {
+ e.preventDefault();
+ focus(lastElement);
+ }
+ });
+ };
+
// kendo.saveAs -----------------------------------------------
(function() {
function postToProxy(dataURI, fileName, proxyURL, proxyTarget) {
@@ -4605,7 +4729,7 @@ function pad(number, digits, end) {
}
},
- _same: function(e) {
+ _same: function() {
this.trigger(SAME);
},
@@ -5234,47 +5358,6 @@ function pad(number, digits, end) {
abs = Math.abs,
MAX_DOUBLE_TAP_DISTANCE = 20;
- var Swipe = kendo.Class.extend({
- init: function(element, callback, options) {
- options = $.extend({
- minXDelta: 30,
- maxYDelta: 20,
- maxDuration: 1000
- }, options);
-
- new kendo.UserEvents(element, {
- surface: options.surface,
- allowSelection: true,
-
- start: function(e) {
- if (abs(e.x.velocity) * 2 >= abs(e.y.velocity)) {
- e.sender.capture();
- }
- },
-
- move: function(e) {
- var touch = e.touch,
- duration = e.event.timeStamp - touch.startTime,
- direction = touch.x.initialDelta > 0 ? "right" : "left";
-
- if (
- abs(touch.x.initialDelta) >= options.minXDelta &&
- abs(touch.y.initialDelta) < options.maxYDelta &&
- duration < options.maxDuration)
- {
- callback({
- direction: direction,
- touch: touch,
- target: touch.target
- });
-
- touch.cancel();
- }
- }
- });
- }
- });
-
var Touch = Widget.extend({
init: function(element, options) {
var that = this;
@@ -5411,13 +5494,6 @@ function pad(number, digits, end) {
}
});
-
- window.jQuery.fn.kendoMobileSwipe = function(callback, options) {
- this.each(function() {
- new Swipe(this, callback, options);
- });
- };
-
kendo.ui.plugin(Touch);
})(window.kendo.jQuery);
@@ -5448,7 +5524,10 @@ function pad(number, digits, end) {
page: $.noop,
filter: function(params, filter, useVersionFour) {
if (filter) {
- params.$filter = toOdataFilter(filter, useVersionFour);
+ filter = toOdataFilter(filter, useVersionFour);
+ if (filter) {
+ params.$filter = filter;
+ }
}
},
sort: function(params, orderby) {
@@ -5746,7 +5825,9 @@ function pad(number, digits, end) {
if (model.fields) {
each(model.fields, function(field, value) {
if (isPlainObject(value) && value.field) {
- value = extend(value, { field: that.getter(value.field) });
+ if (!$.isFunction(value.field)) {
+ value = extend(value, { field: that.getter(value.field) });
+ }
} else {
value = { field: that.getter(value) };
}
@@ -5969,8 +6050,6 @@ function pad(number, digits, end) {
-var A = 0;
-
/*jshint eqnull: true, loopfunc: true, evil: true */
@@ -6229,6 +6308,41 @@ var A = 0;
return result;
},
+ reduce: function(callback) {
+ var idx = 0,
+ result,
+ length = this.length;
+
+ if (arguments.length == 2) {
+ result = arguments[1];
+ } else if (idx < length) {
+ result = this[idx++];
+ }
+
+ for (; idx < length; idx++) {
+ result = callback(result, this[idx], idx, this);
+ }
+
+ return result;
+ },
+
+ reduceRight: function(callback) {
+ var idx = this.length - 1,
+ result;
+
+ if (arguments.length == 2) {
+ result = arguments[1];
+ } else if (idx > 0) {
+ result = this[idx--];
+ }
+
+ for (; idx >= 0; idx--) {
+ result = callback(result, this[idx], idx, this);
+ }
+
+ return result;
+ },
+
filter: function(callback) {
var idx = 0,
result = [],
@@ -6361,6 +6475,8 @@ var A = 0;
Observable.fn.init.call(this);
+ this._handlers = {};
+
for (field in value) {
member = value[field];
@@ -6375,7 +6491,7 @@ var A = 0;
},
shouldSerialize: function(field) {
- return this.hasOwnProperty(field) && field !== "_events" && typeof this[field] !== FUNCTION && field !== "uid";
+ return this.hasOwnProperty(field) && field !== "_handlers" && field !== "_events" && typeof this[field] !== FUNCTION && field !== "uid";
},
forEach: function(f) {
@@ -6448,6 +6564,12 @@ var A = 0;
current = kendo.getter(field, true)(that);
if (current !== value) {
+ if (current instanceof Observable && this._handlers[field]) {
+ if (this._handlers[field].get) {
+ current.unbind(GET, this._handlers[field].get);
+ }
+ current.unbind(CHANGE, this._handlers[field].change);
+ }
if (!that.trigger("set", { field: field, value: value })) {
if (!composite) {
@@ -6463,8 +6585,10 @@ var A = 0;
parent: noop,
wrap: function(object, field, parent) {
- var that = this,
- type = toString.call(object);
+ var that = this;
+ var get;
+ var change;
+ var type = toString.call(object);
if (object != null && (type === "[object Object]" || type === "[object Array]")) {
var isObservableArray = object instanceof ObservableArray;
@@ -6475,18 +6599,22 @@ var A = 0;
object = new ObservableObject(object);
}
- if (object.parent() != parent()) {
- object.bind(GET, eventHandler(that, GET, field, true));
- object.bind(CHANGE, eventHandler(that, CHANGE, field, true));
- }
+ get = eventHandler(that, GET, field, true);
+ object.bind(GET, get);
+ change = eventHandler(that, CHANGE, field, true);
+ object.bind(CHANGE, change);
+
+ that._handlers[field] = { get: get, change: change };
} else if (type === "[object Array]" || isObservableArray || isDataSource) {
if (!isObservableArray && !isDataSource) {
object = new ObservableArray(object);
}
- if (object.parent() != parent()) {
- object.bind(CHANGE, eventHandler(that, CHANGE, field, false));
- }
+ change = eventHandler(that, CHANGE, field, false);
+
+ object.bind(CHANGE, change);
+
+ that._handlers[field] = { change: change };
}
object.parent = parent;
@@ -6974,6 +7102,20 @@ var A = 0;
return a + ".lastIndexOf('" + b + "', 0) == 0";
},
+ doesnotstartwith: function(a, b, ignore) {
+ if (ignore) {
+ a = "(" + a + " || '').toLowerCase()";
+ if (b) {
+ b = b.toLowerCase();
+ }
+ }
+
+ if (b) {
+ b = quote(b);
+ }
+
+ return a + ".lastIndexOf('" + b + "', 0) == -1";
+ },
endswith: function(a, b, ignore) {
if (ignore) {
a = "(" + a + " || '').toLowerCase()";
@@ -6988,6 +7130,20 @@ var A = 0;
return a + ".indexOf('" + b + "', " + a + ".length - " + (b || "").length + ") >= 0";
},
+ doesnotendwith: function(a, b, ignore) {
+ if (ignore) {
+ a = "(" + a + " || '').toLowerCase()";
+ if (b) {
+ b = b.toLowerCase();
+ }
+ }
+
+ if (b) {
+ b = quote(b);
+ }
+
+ return a + ".indexOf('" + b + "', " + a + ".length - " + (b || "").length + ") < 0";
+ },
contains: function(a, b, ignore) {
if (ignore) {
a = "(" + a + " || '').toLowerCase()";
@@ -7840,34 +7996,6 @@ var A = 0;
}
});
- function cloneGroups(groups) {
- var result = [];
- var item;
- var group;
-
- for (var idx = 0, length = groups.length; idx < length; idx++) {
- item = groups[idx];
- if (!("field" in item && "items" in item && "value" in item)) {
- break;
- }
-
- group = {};
- for (var field in item) {
- var shouldSerialize = item.shouldSerialize ? item.shouldSerialize : item.hasOwnProperty;
- if (shouldSerialize.call(item, field)) {
- group[field] = item[field];
- }
- }
-
- result.push(group);
-
- if (group.hasSubgroups) {
- result = result.concat(cloneGroups(group.items));
- }
- }
- return result;
- }
-
function mergeGroups(target, dest, skip, take) {
var group,
idx = 0,
@@ -7940,7 +8068,7 @@ var A = 0;
}
function wrapGroupItems(data, model) {
- var idx, length, group, items;
+ var idx, length, group;
if (model) {
for (idx = 0, length = data.length; idx < length; idx++) {
group = data.at(idx);
@@ -8022,34 +8150,10 @@ var A = 0;
}
}
- function wrapInEmptyGroup(groups, model) {
- var parent,
- group,
- idx,
- length;
-
- for (idx = groups.length-1, length = 0; idx >= length; idx--) {
- group = groups[idx];
- parent = {
- value: model.get(group.field),
- field: group.field,
- items: parent ? [parent] : [model],
- hasSubgroups: !!parent,
- aggregates: {}
- };
- }
-
- return parent;
- }
-
function indexOfPristineModel(data, model) {
if (model) {
return indexOf(data, function(item) {
- if (item.uid) {
- return item.uid == model.uid;
- }
-
- return item[model.idField] === model.id;
+ return (item.uid && item.uid == model.uid) || (item[model.idField] === model.id && model.id !== model._defaultId);
});
}
return -1;
@@ -8173,7 +8277,7 @@ var A = 0;
Observable.fn.init.call(that);
- that.transport = Transport.create(options, data);
+ that.transport = Transport.create(options, data, that);
if (isFunction(that.transport.push)) {
that.transport.push({
@@ -8192,7 +8296,7 @@ var A = 0;
return JSON.parse(localStorage.getItem(key));
},
setItem: function(item) {
- localStorage.setItem(key, stringify(item));
+ localStorage.setItem(key, stringify(that.reader.serialize(item)));
}
};
} else {
@@ -8226,6 +8330,10 @@ var A = 0;
batch: false
},
+ clone: function() {
+ return this;
+ },
+
online: function(value) {
if (value !== undefined) {
if (this._online != value) {
@@ -8251,7 +8359,7 @@ var A = 0;
return this._storage.setItem(state);
}
- return this._storage.getItem() || {};
+ return this._storage.getItem() || [];
},
_isServerGrouped: function() {
@@ -8415,7 +8523,7 @@ var A = 0;
}
if (this._isServerGrouped()) {
- this._data.splice(index, 0, wrapInEmptyGroup(this.group(), model));
+ this._data.splice(index, 0, this._wrapInEmptyGroup(model));
} else {
this._data.splice(index, 0, model);
}
@@ -8443,7 +8551,7 @@ var A = 0;
var pristine = result.toJSON();
if (this._isServerGrouped()) {
- pristine = wrapInEmptyGroup(this.group(), pristine);
+ pristine = this._wrapInEmptyGroup(pristine);
}
this._pristineData.push(pristine);
@@ -8565,14 +8673,43 @@ var A = 0;
return model;
},
+ destroyed: function() {
+ return this._destroyed;
+ },
+
+ created: function() {
+ var idx,
+ length,
+ result = [],
+ data = this._flatData(this._data);
+
+ for (idx = 0, length = data.length; idx < length; idx++) {
+ if (data[idx].isNew && data[idx].isNew()) {
+ result.push(data[idx]);
+ }
+ }
+ return result;
+ },
+
+ updated: function() {
+ var idx,
+ length,
+ result = [],
+ data = this._flatData(this._data);
+
+ for (idx = 0, length = data.length; idx < length; idx++) {
+ if ((data[idx].isNew && !data[idx].isNew()) && data[idx].dirty) {
+ result.push(data[idx]);
+ }
+ }
+ return result;
+ },
+
sync: function() {
var that = this,
- idx,
- length,
created = [],
updated = [],
- destroyed = that._destroyed,
- data = that._flatData(that._data);
+ destroyed = that._destroyed;
var promise = $.Deferred().resolve().promise();
@@ -8582,18 +8719,18 @@ var A = 0;
return promise;
}
- for (idx = 0, length = data.length; idx < length; idx++) {
- if (data[idx].isNew()) {
- created.push(data[idx]);
- } else if (data[idx].dirty) {
- updated.push(data[idx]);
- }
- }
+ created = that.created();
+ updated = that.updated();
var promises = [];
- promises.push.apply(promises, that._send("create", created));
- promises.push.apply(promises, that._send("update", updated));
- promises.push.apply(promises, that._send("destroy", destroyed));
+
+ if (that.options.batch && that.transport.submit) {
+ promises = that._sendSubmit(created, updated, destroyed);
+ } else {
+ promises.push.apply(promises, that._send("create", created));
+ promises.push.apply(promises, that._send("update", updated));
+ promises.push.apply(promises, that._send("destroy", destroyed));
+ }
promise = $.when
.apply(null, promises)
@@ -8642,7 +8779,7 @@ var A = 0;
hasChanges: function() {
var idx,
length,
- data = this._data;
+ data = this._flatData(this._data);
if (this._destroyed.length) {
return true;
@@ -8694,7 +8831,7 @@ var A = 0;
models[idx].accept(response[idx]);
if (type === "create") {
- pristine.push(serverGroup ? wrapInEmptyGroup(that.group(), models[idx]) : response[idx]);
+ pristine.push(serverGroup ? that._wrapInEmptyGroup(models[idx]) : response[idx]);
} else if (type === "update") {
that._updatePristineForModel(models[idx], response[idx]);
}
@@ -8777,6 +8914,73 @@ var A = 0;
});
},
+ _submit: function(promises, data) {
+ var that = this;
+
+ that.trigger(REQUESTSTART, { type: "submit" });
+
+ that.transport.submit(extend({
+ success: function(response, type) {
+ var promise = $.grep(promises, function(x) {
+ return x.type == type;
+ })[0];
+
+ if (promise) {
+ promise.resolve({
+ response: response,
+ models: promise.models,
+ type: type
+ });
+ }
+ },
+ error: function(response, status, error) {
+ for (var idx = 0; idx < promises.length; idx++) {
+ promises[idx].reject(response);
+ }
+
+ that.error(response, status, error);
+ }
+ }, data));
+ },
+
+ _sendSubmit: function(created, updated, destroyed) {
+ var that = this,
+ promises = [];
+
+ if (that.options.batch) {
+ if (created.length) {
+ promises.push($.Deferred(function(deferred) {
+ deferred.type = "create";
+ deferred.models = created;
+ }));
+ }
+
+ if (updated.length) {
+ promises.push($.Deferred(function(deferred) {
+ deferred.type = "update";
+ deferred.models = updated;
+ }));
+ }
+
+ if (destroyed.length) {
+ promises.push($.Deferred(function(deferred) {
+ deferred.type = "destroy";
+ deferred.models = destroyed;
+ }));
+ }
+
+ that._submit(promises, {
+ data: {
+ created: that.reader.serialize(toJSON(created)),
+ updated: that.reader.serialize(toJSON(updated)),
+ destroyed: that.reader.serialize(toJSON(destroyed))
+ }
+ });
+ }
+
+ return promises;
+ },
+
_promise: function(data, models, type) {
var that = this;
@@ -8834,7 +9038,7 @@ var A = 0;
that.transport.read({
data: params,
success: function(data) {
- that.success(data);
+ that.success(data, params);
deferred.resolve();
},
@@ -8847,7 +9051,7 @@ var A = 0;
}
});
} else if (that.options.offlineStorage != null){
- that.success(that.offlineData());
+ that.success(that.offlineData(), params);
deferred.resolve();
}
@@ -8890,13 +9094,23 @@ var A = 0;
data = that._readData(data);
var items = [];
+ var itemIds = {};
+ var model = that.reader.model;
+ var idField = model ? model.idField : "id";
+ var idx;
- for (var idx = 0; idx < data.length; idx++) {
+ for (idx = 0; idx < this._destroyed.length; idx++) {
+ var id = this._destroyed[idx][idField];
+ itemIds[id] = id;
+ }
+
+ for (idx = 0; idx < data.length; idx++) {
var item = data[idx];
var state = item.__state__;
-
if (state == "destroy") {
- this._destroyed.push(this._createNewModel(item));
+ if (!itemIds[item[idField]]) {
+ this._destroyed.push(this._createNewModel(item));
+ }
} else {
items.push(item);
}
@@ -8978,13 +9192,15 @@ var A = 0;
if (this.options.offlineStorage != null) {
var state = items(this._data);
+ var destroyed = [];
+
for (var idx = 0; idx < this._destroyed.length; idx++) {
var item = this._destroyed[idx].toJSON();
item.__state__ = "destroy";
- state.push(item);
+ destroyed.push(item);
}
- this.offlineData(state);
+ this.offlineData(state.concat(destroyed));
if (updatePristine) {
this._pristineData = state;
@@ -8997,7 +9213,7 @@ var A = 0;
start = that._skip || 0,
end = start + that._flatData(data, true).length;
- that._ranges.push({ start: start, end: end, data: data });
+ that._ranges.push({ start: start, end: end, data: data, timestamp: new Date().getTime() });
that._ranges.sort( function(x, y) { return x.start - y.start; } );
},
@@ -9084,20 +9300,25 @@ var A = 0;
return false;
},
+ _shouldWrap: function(data) {
+ var model = this.reader.model;
+
+ if (model && data.length) {
+ return !(data[0] instanceof model);
+ }
+
+ return false;
+ },
+
_observe: function(data) {
var that = this,
- model = that.reader.model,
- wrap = false;
+ model = that.reader.model;
that._shouldDetachObservableParents = true;
- if (model && data.length) {
- wrap = !(data[0] instanceof model);
- }
-
if (data instanceof ObservableArray) {
that._shouldDetachObservableParents = false;
- if (wrap) {
+ if (that._shouldWrap(data)) {
data.type = that.reader.model;
data.wrapAll(data, data);
}
@@ -9120,6 +9341,27 @@ var A = 0;
return data.bind(CHANGE, that._changeHandler);
},
+ _updateTotalForAction: function(action, items) {
+ var that = this;
+
+ var total = parseInt(that._total, 10);
+
+ if (!isNumber(that._total)) {
+ total = parseInt(that._pristineTotal, 10);
+ }
+ if (action === "add") {
+ total += items.length;
+ } else if (action === "remove") {
+ total -= items.length;
+ } else if (action !== "itemchange" && action !== "sync" && !that.options.serverPaging) {
+ total = that._pristineTotal;
+ } else if (action === "sync") {
+ total = that._pristineTotal = parseInt(that._total, 10);
+ }
+
+ that._total = total;
+ },
+
_change: function(e) {
var that = this, idx, length, action = e ? e.action : "";
@@ -9132,23 +9374,20 @@ var A = 0;
}
if (that.options.autoSync && (action === "add" || action === "remove" || action === "itemchange")) {
+
+ var handler = function(args) {
+ if (args.action === "sync") {
+ that.unbind("change", handler);
+ that._updateTotalForAction(action, e.items);
+ }
+ };
+
+ that.first("change", handler);
+
that.sync();
- } else {
- var total = parseInt(that._total, 10);
- if (!isNumber(that._total)) {
- total = parseInt(that._pristineTotal, 10);
- }
- if (action === "add") {
- total += e.items.length;
- } else if (action === "remove") {
- total -= e.items.length;
- } else if (action !== "itemchange" && action !== "sync" && !that.options.serverPaging) {
- total = that._pristineTotal;
- } else if (action === "sync") {
- total = that._pristineTotal = parseInt(that._total, 10);
- }
- that._total = total;
+ } else {
+ that._updateTotalForAction(action, e ? e.items : []);
that._process(that._data, e);
}
@@ -9398,8 +9637,8 @@ var A = 0;
return that._filter;
}
- that._query({ filter: val, page: 1 });
that.trigger("reset");
+ that._query({ filter: val, page: 1 });
},
group: function(val) {
@@ -9429,7 +9668,53 @@ var A = 0;
},
aggregates: function() {
- return this._aggregateResult;
+ var result = this._aggregateResult;
+
+ if (isEmptyObject(result)) {
+ result = this._emptyAggregates(this.aggregate());
+ }
+
+ return result;
+ },
+
+ _emptyAggregates: function(aggregates) {
+ var result = {};
+
+ if (!isEmptyObject(aggregates)) {
+ var aggregate = {};
+
+ if (!isArray(aggregates)){
+ aggregates = [aggregates];
+ }
+
+ for (var idx = 0; idx = length; idx--) {
+ group = groups[idx];
+ parent = {
+ value: model.get(group.field),
+ field: group.field,
+ items: parent ? [parent] : [model],
+ hasSubgroups: !!parent,
+ aggregates: this._emptyAggregates(group.aggregates)
+ };
+ }
+
+ return parent;
},
totalPages: function() {
@@ -9464,7 +9749,14 @@ var A = 0;
this._skipRequestsInProgress = false;
},
+ _timeStamp: function() {
+ return new Date().getTime();
+ },
+
range: function(skip, take) {
+ this._currentRequestTimeStamp = this._timeStamp();
+ this._skipRequestsInProgress = true;
+
skip = math.min(skip || 0, this.total());
var that = this,
@@ -9472,12 +9764,10 @@ var A = 0;
size = math.min(pageSkip + take, that.total()),
data;
- that._skipRequestsInProgress = false;
-
data = that._findRange(skip, math.min(skip + take, that.total()));
if (data.length) {
- that._skipRequestsInProgress = true;
+
that._pending = undefined;
that._skip = skip > that.skip() ? math.min(size, (that.totalPages() - 1) * that.take()) : pageSkip;
@@ -9596,7 +9886,6 @@ var A = 0;
_mergeGroups: function(data, range, skip, take) {
if (this._isServerGrouped()) {
- //var temp = cloneGroups(range),
var temp = range.toJSON(),
prevGroup;
@@ -9626,10 +9915,11 @@ var A = 0;
_prefetchSuccessHandler: function (skip, size, callback, force) {
var that = this;
+ var timestamp = that._timeStamp();
return function(data) {
var found = false,
- range = { start: skip, end: size, data: [] },
+ range = { start: skip, end: size, data: [], timestamp: that._timeStamp() },
idx,
length,
temp;
@@ -9643,6 +9933,7 @@ var A = 0;
temp = that._readData(data);
if (temp.length) {
+
for (idx = 0, length = that._ranges.length; idx < length; idx++) {
if (that._ranges[idx].start === skip) {
found = true;
@@ -9660,7 +9951,7 @@ var A = 0;
that._ranges.sort( function(x, y) { return x.start - y.start; } );
that._total = that.reader.total(data);
- if (force || !that._skipRequestsInProgress) {
+ if (force || (timestamp >= that._currentRequestTimeStamp || !that._skipRequestsInProgress)) {
if (callback && temp.length) {
callback();
} else {
@@ -9692,7 +9983,11 @@ var A = 0;
if (!that.trigger(REQUESTSTART, { type: "read" })) {
that.transport.read({
data: that._params(options),
- success: that._prefetchSuccessHandler(skip, size, callback)
+ success: that._prefetchSuccessHandler(skip, size, callback),
+ error: function() {
+ var args = slice.call(arguments);
+ that.error.apply(that, args);
+ }
});
} else {
that._dequeueRequest();
@@ -9783,13 +10078,17 @@ var A = 0;
var Transport = {};
- Transport.create = function(options, data) {
+ Transport.create = function(options, data, dataSource) {
var transport,
- transportOptions = options.transport;
+ transportOptions = options.transport ? $.extend({}, options.transport) : null;
if (transportOptions) {
transportOptions.read = typeof transportOptions.read === STRING ? { url: transportOptions.read } : transportOptions.read;
+ if (options.type === "jsdo") {
+ transportOptions.dataSource = dataSource;
+ }
+
if (options.type) {
kendo.data.transports = kendo.data.transports || {};
kendo.data.schemas = kendo.data.schemas || {};
@@ -9832,6 +10131,10 @@ var A = 0;
data = inferTable(table, fields);
} else if (select) {
data = inferSelect(select, fields);
+
+ if (dataSource.group === undefined && data[0] && data[0].optgroup !== undefined) {
+ dataSource.group = "optgroup";
+ }
}
}
@@ -9849,6 +10152,9 @@ var A = 0;
}
dataSource.data = data;
+
+ select = null;
+ dataSource.select = null;
table = null;
dataSource.table = null;
@@ -9856,24 +10162,35 @@ var A = 0;
};
function inferSelect(select, fields) {
- var options = $(select)[0].children,
- idx,
- length,
- data = [],
- record,
- firstField = fields[0],
- secondField = fields[1],
- value,
- option;
+ select = $(select)[0];
+ var options = select.options;
+ var firstField = fields[0];
+ var secondField = fields[1];
+
+ var data = [];
+ var idx, length;
+ var optgroup;
+ var option;
+ var record;
+ var value;
for (idx = 0, length = options.length; idx < length; idx++) {
record = {};
option = options[idx];
+ optgroup = option.parentNode;
- if (option.disabled) {
+ if (optgroup === select) {
+ optgroup = null;
+ }
+
+ if (option.disabled || (optgroup && optgroup.disabled)) {
continue;
}
+ if (optgroup) {
+ record.optgroup = optgroup.label;
+ }
+
record[firstField.field] = option.text;
value = option.attributes.value;
@@ -10168,7 +10485,12 @@ var A = 0;
},
_find: function(method, value) {
- var idx, length, node, data, children;
+ var idx, length, node, children;
+ var data = this._data;
+
+ if (!data) {
+ return;
+ }
node = DataSource.fn[method].call(this, value);
@@ -10178,10 +10500,6 @@ var A = 0;
data = this._flatData(this._data);
- if (!data) {
- return;
- }
-
for (idx = 0, length = data.length; idx < length; idx++) {
children = data[idx].children;
@@ -10325,9 +10643,7 @@ var A = 0;
at: function(index) {
var pageSize = this.pageSize,
- item,
- itemPresent = true,
- changeTo;
+ itemPresent = true;
if (index >= this.total()) {
this.trigger("endreached", {index: index });
@@ -10615,32 +10931,25 @@ var A = 0;
/*jshint eqnull: true */
(function ($, undefined) {
var kendo = window.kendo,
- browser = kendo.support.browser,
Observable = kendo.Observable,
ObservableObject = kendo.data.ObservableObject,
ObservableArray = kendo.data.ObservableArray,
toString = {}.toString,
binders = {},
- slice = Array.prototype.slice,
Class = kendo.Class,
- innerText,
proxy = $.proxy,
VALUE = "value",
SOURCE = "source",
EVENTS = "events",
CHECKED = "checked",
+ CSS = "css",
deleteExpando = true,
+ FUNCTION = "function",
CHANGE = "change";
(function() {
var a = document.createElement("a");
- if (a.innerText !== undefined) {
- innerText = "innerText";
- } else if (a.textContent !== undefined) {
- innerText = "textContent";
- }
-
try {
delete a.test;
} catch(e) {
@@ -10890,7 +11199,7 @@ var A = 0;
var TypedBinder = Binder.extend({
dataType: function() {
- var dataType = this.element.getAttribute("data-type") || this.element.type || "text";
+ var dataType = this.element.getAttribute("data-type") || this.element.type || "text";
return dataType.toLowerCase();
},
@@ -10898,7 +11207,7 @@ var A = 0;
return this._parseValue(this.element.value, this.dataType());
},
- _parseValue : function (value, dataType){
+ _parseValue: function (value, dataType){
if (dataType == "date") {
value = kendo.parseDate(value, "yyyy-MM-dd");
} else if (dataType == "datetime-local") {
@@ -10923,6 +11232,23 @@ var A = 0;
}
});
+ binders.css = Binder.extend({
+ init: function(element, bindings, options) {
+ Binder.fn.init.call(this, element, bindings, options);
+ this.classes = {};
+ },
+ refresh: function(className) {
+ var element = $(this.element),
+ binding = this.bindings.css[className],
+ hasClass = this.classes[className] = binding.get();
+ if(hasClass){
+ element.addClass(className);
+ }else{
+ element.removeClass(className);
+ }
+ }
+ });
+
binders.style = Binder.extend({
refresh: function(key) {
this.element.style[key] = this.bindings.style[key].get() || "";
@@ -10992,12 +11318,12 @@ var A = 0;
binders.text = Binder.extend({
refresh: function() {
var text = this.bindings.text.get();
-
+ var dataFormat = this.element.getAttribute("data-format") || "";
if (text == null) {
text = "";
}
- this.element[innerText] = text;
+ $(this.element).text(kendo.toString(text, dataFormat));
}
});
@@ -11137,7 +11463,6 @@ var A = 0;
} else {
template = "#:data#";
}
-
template = kendo.template(template);
}
@@ -11171,7 +11496,7 @@ var A = 0;
for (idx = 0; idx < items.length; idx++) {
var child = element.children[index];
- unbindElementTree(child);
+ unbindElementTree(child, true);
element.removeChild(child);
}
},
@@ -11193,7 +11518,7 @@ var A = 0;
}
if (this.bindings.template) {
- unbindElementChildren(element);
+ unbindElementChildren(element, true);
$(element).html(this.bindings.template.render(source));
@@ -11286,6 +11611,8 @@ var A = 0;
}
if (element.value === value.toString()) {
element.checked = true;
+ }else{
+ element.checked = false;
}
}
},
@@ -11307,6 +11634,30 @@ var A = 0;
};
binders.select = {
+ source: binders.source.extend({
+ refresh: function(e) {
+ var that = this,
+ source = that.bindings.source.get();
+
+ if (source instanceof ObservableArray || source instanceof kendo.data.DataSource) {
+ e = e || {};
+ if (e.action == "add") {
+ that.add(e.index, e.items);
+ } else if (e.action == "remove") {
+ that.remove(e.index, e.items);
+ } else if (e.action == "itemchange" || e.action === undefined) {
+ that.render();
+ if(that.bindings.value){
+ if (that.bindings.value) {
+ that.element.value = retrievePrimitiveValues(that.bindings.value.get(), $(that.element).data("valueField"));
+ }
+ }
+ }
+ } else {
+ that.render();
+ }
+ }
+ }),
value: TypedBinder.extend({
init: function(target, bindings, options) {
TypedBinder.fn.init.call(this, target, bindings, options);
@@ -11349,7 +11700,21 @@ var A = 0;
idx,
length;
- values = this.parsedValue();
+ for (idx = 0, length = element.options.length; idx < length; idx++) {
+ option = element.options[idx];
+
+ if (option.selected) {
+ value = option.attributes.value;
+
+ if (value && value.specified) {
+ value = option.value;
+ } else {
+ value = option.text;
+ }
+
+ values.push(this._parseValue(value, this.dataType()));
+ }
+ }
if (field) {
source = this.bindings.source.get();
@@ -11359,7 +11724,8 @@ var A = 0;
for (valueIndex = 0; valueIndex < values.length; valueIndex++) {
for (idx = 0, length = source.length; idx < length; idx++) {
- var match = valuePrimitive ? (this._parseValue(values[valueIndex], this.dataType()) === source[idx].get(field)) : (this._parseValue(source[idx].get(field), this.dataType()).toString() === values[valueIndex]);
+ var sourceValue = this._parseValue(source[idx].get(field), this.dataType());
+ var match = (String(sourceValue) === values[valueIndex]);
if (match) {
values[valueIndex] = source[idx];
break;
@@ -11381,7 +11747,6 @@ var A = 0;
var optionIndex,
element = this.element,
options = element.options,
- valuePrimitive = this.options.valuePrimitive,
value = this.bindings[VALUE].get(),
values = value,
field = this.options.valueField || this.options.textField,
@@ -11453,7 +11818,7 @@ var A = 0;
items = e.removedItems || widget.items();
for (idx = 0, length = items.length; idx < length; idx++) {
- unbindElementTree(items[idx]);
+ unbindElementTree(items[idx], false);
}
},
@@ -11474,7 +11839,13 @@ var A = 0;
dataSource = widget[fieldName],
view,
parents,
- groups = dataSource.group() || [];
+ hds = kendo.data.HierarchicalDataSource;
+
+ if (hds && dataSource instanceof hds) {
+ // suppress binding of HDS items, because calling view() on root
+ // will return only root items, and widget.items() returns all items
+ return;
+ }
if (items.length) {
view = e.addedDataItems || dataSource.flatView();
@@ -11489,7 +11860,8 @@ var A = 0;
refresh: function(e) {
var that = this,
source,
- widget = that.widget;
+ widget = that.widget,
+ select, multiselect;
e = e || {};
@@ -11509,6 +11881,13 @@ var A = 0;
widget[setter](source._dataSource);
} else {
widget[fieldName].data(source);
+
+ select = kendo.ui.Select && widget instanceof kendo.ui.Select;
+ multiselect = kendo.ui.MultiSelect && widget instanceof kendo.ui.MultiSelect;
+
+ if (that.bindings.value && (select || multiselect)) {
+ widget.value(retrievePrimitiveValues(that.bindings.value.get(), widget.options.dataValueField));
+ }
}
}
}
@@ -11688,7 +12067,7 @@ var A = 0;
value = null;
} else {
if (!source || source instanceof kendo.data.DataSource) {
- source = this.widget.dataSource.view();
+ source = this.widget.dataSource.flatView();
}
if (isArray) {
@@ -11730,28 +12109,45 @@ var A = 0;
},
refresh: function() {
-
if (!this._initChange) {
- var field = this.options.dataValueField || this.options.dataTextField,
- value = this.bindings.value.get(),
- idx = 0, length,
- values = [];
+ var widget = this.widget;
+ var options = widget.options;
+ var textField = options.dataTextField;
+ var valueField = options.dataValueField || textField;
+ var value = this.bindings.value.get();
+ var text = options.text || "";
+ var idx = 0, length;
+ var values = [];
if (value === undefined) {
value = null;
}
- if (field) {
+ if (valueField) {
if (value instanceof ObservableArray) {
for (length = value.length; idx < length; idx++) {
- values[idx] = value[idx].get(field);
+ values[idx] = value[idx].get(valueField);
}
value = values;
} else if (value instanceof ObservableObject) {
- value = value.get(field);
+ text = value.get(textField);
+ value = value.get(valueField);
+ }
+ }
+
+ if (options.autoBind === false && !options.cascadeFrom && widget.listView && !widget.listView.isBound()) {
+ if (textField === valueField && !text) {
+ text = value;
+ }
+
+ if (!text && (value || value === 0) && options.valuePrimitive) {
+ widget.value(value);
+ } else {
+ widget._preselect(value, text);
}
+ } else {
+ widget.value(value);
}
- this.widget.value(value);
}
this._initChange = false;
@@ -11858,8 +12254,11 @@ var A = 0;
refresh: function() {
if (!this._initChange) {
- var field = this.options.dataValueField || this.options.dataTextField,
+ var options = this.options,
+ widget = this.widget,
+ field = options.dataValueField || options.dataTextField,
value = this.bindings.value.get(),
+ data = value,
idx = 0, length,
values = [],
selectedValue;
@@ -11880,7 +12279,11 @@ var A = 0;
}
}
- this.widget.value(value);
+ if (options.autoBind === false && options.valuePrimitive !== true && !widget.listView.isBound()) {
+ widget._preselect(data, value);
+ } else {
+ widget.value(value);
+ }
}
},
@@ -11975,6 +12378,7 @@ var A = 0;
hasSource,
hasEvents,
hasChecked,
+ hasCss,
widgetBinding = this instanceof WidgetBindingTarget,
specificBinders = this.binders();
@@ -11987,6 +12391,8 @@ var A = 0;
hasEvents = true;
} else if (key == CHECKED) {
hasChecked = true;
+ } else if (key == CSS) {
+ hasCss = true;
} else {
this.applyBinding(key, bindings, specificBinders);
}
@@ -12006,6 +12412,10 @@ var A = 0;
if (hasEvents && !widgetBinding) {
this.applyBinding(EVENTS, bindings, specificBinders);
}
+
+ if (hasCss && !widgetBinding) {
+ this.applyBinding(CSS, bindings, specificBinders);
+ }
},
binders: function() {
@@ -12145,7 +12555,7 @@ var A = 0;
parents = parents || [source];
if (role || bind) {
- unbindElement(element);
+ unbindElement(element, false);
}
if (role) {
@@ -12192,6 +12602,10 @@ var A = 0;
bindings.events = createBindings(bind.events, parents, EventBinding);
}
+ if (bind.css) {
+ bindings.css = createBindings(bind.css, parents, Binding);
+ }
+
target.bind(bindings);
}
@@ -12228,7 +12642,7 @@ var A = 0;
}
}
- function unbindElement(element) {
+ function unbindElement(element, destroyWidget) {
var bindingTarget = element.kendoBindingTarget;
if (bindingTarget) {
@@ -12242,20 +12656,27 @@ var A = 0;
element.kendoBindingTarget = null;
}
}
+
+ if(destroyWidget) {
+ var widget = kendo.widgetInstance($(element));
+ if (widget && typeof widget.destroy === FUNCTION) {
+ widget.destroy();
+ }
+ }
}
- function unbindElementTree(element) {
- unbindElement(element);
+ function unbindElementTree(element, destroyWidgets) {
+ unbindElement(element, destroyWidgets);
- unbindElementChildren(element);
+ unbindElementChildren(element, destroyWidgets);
}
- function unbindElementChildren(element) {
+ function unbindElementChildren(element, destroyWidgets) {
var children = element.children;
if (children) {
for (var idx = 0, length = children.length; idx < length; idx++) {
- unbindElementTree(children[idx]);
+ unbindElementTree(children[idx], destroyWidgets);
}
}
}
@@ -12266,7 +12687,7 @@ var A = 0;
dom = $(dom);
for (idx = 0, length = dom.length; idx < length; idx++ ) {
- unbindElementTree(dom[idx]);
+ unbindElementTree(dom[idx], false);
}
}
@@ -12279,6 +12700,29 @@ var A = 0;
}
}
+ function retrievePrimitiveValues(value, valueField) {
+ var values = [];
+ var idx = 0;
+ var length;
+ var item;
+
+ if (!valueField) {
+ return value;
+ }
+
+ if (value instanceof ObservableArray) {
+ for (length = value.length; idx < length; idx++) {
+ item = value[idx];
+ values[idx] = item.get ? item.get(valueField) : item[valueField];
+ }
+ value = values;
+ } else if (value instanceof ObservableObject) {
+ value = value.get(valueField);
+ }
+
+ return value;
+ }
+
kendo.unbind = unbind;
kendo.bind = bind;
kendo.data.binders = binders;
@@ -12370,7 +12814,6 @@ var A = 0;
PERSPECTIVE = cssPrefix + "perspective",
DEFAULT_PERSPECTIVE = "1500px",
TRANSFORM_PERSPECTIVE = "perspective(" + DEFAULT_PERSPECTIVE + ")",
- ios7 = support.mobileOS && support.mobileOS.majorVersion == 7,
directions = {
left: {
reverse: "right",
@@ -13957,7 +14400,7 @@ var A = 0;
return that.element;
},
- clone: function(back) {
+ clone: function() {
return new ViewClone(this);
},
@@ -14503,7 +14946,8 @@ var A = 0;
step: "{0} is not valid",
email: "{0} is not valid email",
url: "{0} is not valid URL",
- date: "{0} is not valid date"
+ date: "{0} is not valid date",
+ dateCompare: "End date should be greater than or equal to the start date"
},
rules: {
required: function(input) {
@@ -14807,6 +15251,7 @@ var A = 0;
var kendo = window.kendo,
support = kendo.support,
document = window.document,
+ $window = $(window),
Class = kendo.Class,
Widget = kendo.ui.Widget,
Observable = kendo.Observable,
@@ -14879,7 +15324,7 @@ var A = 0;
for (i = 0; i < areaLen; i ++) {
theFilter = areas[i];
- if (support.matchesSelector.call(target, theFilter.options.filter)) {
+ if ($.contains(theFilter.element[0], target) && support.matchesSelector.call(target, theFilter.options.filter)) {
return { target: theFilter, targetElement: target };
}
}
@@ -15448,6 +15893,7 @@ var A = 0;
filter: null,
ignore: null,
holdToDrag: false,
+ autoScroll: false,
dropped: false
},
@@ -15539,9 +15985,15 @@ var A = 0;
that.angular("compile", function(){
that.hint.removeAttr("ng-repeat");
+ var scopeTarget = $(e.target);
+
+ while (!scopeTarget.data("$$kendoScope") && scopeTarget.length) {
+ scopeTarget = scopeTarget.parent();
+ }
+
return {
elements: that.hint.get(),
- scopeFrom: e.target
+ scopeFrom: scopeTarget.data("$$kendoScope")
};
});
}
@@ -15554,14 +16006,14 @@ var A = 0;
that.boundaries = containerBoundaries(container, that.hint);
}
+ $(document).on(KEYUP, that._captureEscape);
+
if (that._trigger(DRAGSTART, e)) {
that.userEvents.cancel();
that._afterEnd();
}
that.userEvents.capture();
-
- $(document).on(KEYUP, that._captureEscape);
},
_hold: function(e) {
@@ -15579,7 +16031,9 @@ var A = 0;
e.preventDefault();
- that._withDropTarget(e, function(target, targetElement) {
+ var cursorElement = this._elementUnderCursor(e);
+
+ that._withDropTarget(cursorElement, function(target, targetElement) {
if (!target) {
if (lastDropTarget) {
lastDropTarget._trigger(DRAGLEAVE, extend(e, { dropTarget: $(lastDropTarget.targetElement) }));
@@ -15600,35 +16054,109 @@ var A = 0;
lastDropTarget = extend(target, { targetElement: targetElement });
});
- that._trigger(DRAG, extend(e, { dropTarget: lastDropTarget }));
+ that._trigger(DRAG, extend(e, { dropTarget: lastDropTarget, elementUnderCursor: cursorElement }));
+
+ if (this.options.autoScroll) {
+ if (this._cursorElement !== cursorElement) {
+ this._scrollableParent = findScrollableParent(cursorElement);
+ this._cursorElement = cursorElement;
+ }
+
+ // chrome seems to trigger mousemove when mouse is moved outside of the window (over the Chrome), too.
+ if (this._scrollableParent[0]) {
+ var velocity = autoScrollVelocity(e.x.location, e.y.location, scrollableViewPort(this._scrollableParent));
+
+ this._scrollCompenstation = $.extend({}, this.hintOffset);
+ this._scrollVelocity = velocity;
+
+ if (velocity.y === 0 && velocity.x === 0) {
+ clearInterval(this._scrollInterval);
+ this._scrollInterval = null;
+ } else if(!this._scrollInterval) {
+ this._scrollInterval = setInterval($.proxy(this, "_autoScroll"), 50);
+ }
+ }
+ }
if (that.hint) {
that._updateHint(e);
}
},
- _end: function(e) {
- var that = this;
+ _autoScroll: function() {
+ var parent = this._scrollableParent[0],
+ velocity = this._scrollVelocity,
+ compensation = this._scrollCompenstation;
+
+ if (!parent) {
+ return;
+ }
+
+ var yIsScrollable, xIsScrollable;
+ var isBody = parent === document.body;
+
+ if (isBody) {
+ yIsScrollable = document.body.offsetHeight > $window.height();
+ xIsScrollable = document.body.offsetWidth > $window.width();
+ } else {
+ yIsScrollable = parent.offsetHeight <= parent.scrollHeight;
+ xIsScrollable = parent.offsetWidth <= parent.scrollWidth;
+ }
+
+ var yDelta = parent.scrollTop + velocity.y;
+ var yInBounds = yIsScrollable && yDelta > 0 && yDelta < parent.scrollHeight;
- that._withDropTarget(e, function(target, targetElement) {
+ var xDelta = parent.scrollLeft + velocity.x;
+ var xInBounds = xIsScrollable && xDelta > 0 && xDelta < parent.scrollWidth;
+
+ if (yInBounds) {
+ parent.scrollTop += velocity.y;
+ }
+
+ if (xInBounds) {
+ parent.scrollLeft += velocity.x;
+ }
+
+ if (isBody && (xInBounds || yInBounds)) {
+ if (yInBounds) {
+ compensation.top += velocity.y;
+ }
+
+ if (xInBounds) {
+ compensation.left += velocity.x;
+ }
+
+ this.hint.css(compensation);
+ }
+ },
+
+ _end: function(e) {
+ this._withDropTarget(this._elementUnderCursor(e), function(target, targetElement) {
if (target) {
target._drop(extend({}, e, { dropTarget: $(targetElement) }));
lastDropTarget = null;
}
});
- that._trigger(DRAGEND, e);
- that._cancel(e.event);
+ this._cancel(this._trigger(DRAGEND, e));
},
- _cancel: function() {
+ _cancel: function(isDefaultPrevented) {
var that = this;
+ that._scrollableParent = null;
+ clearInterval(this._scrollInterval);
that._activated = false;
if (that.hint && !that.dropped) {
setTimeout(function() {
- that.hint.stop(true, true).animate(that.currentTargetOffset, "fast", that._afterEndHandler);
+ that.hint.stop(true, true);
+
+ if (isDefaultPrevented) {
+ that._afterEndHandler();
+ } else {
+ that.hint.animate(that.currentTargetOffset, "fast", that._afterEndHandler);
+ }
}, 0);
} else {
@@ -15648,33 +16176,37 @@ var A = 0;
y: e.y,
currentTarget: that.currentTarget,
initialTarget: e.touch ? e.touch.initialTouch : null,
- dropTarget: e.dropTarget
+ dropTarget: e.dropTarget,
+ elementUnderCursor: e.elementUnderCursor
}
));
},
- _withDropTarget: function(e, callback) {
- var that = this,
- target, result,
- options = that.options,
- targets = dropTargets[options.group],
- areas = dropAreas[options.group];
-
- if (targets && targets.length || areas && areas.length) {
+ _elementUnderCursor: function(e) {
+ var target = elementUnderCursor(e),
+ hint = this.hint;
+ if (hint && contains(hint[0], target)) {
+ hint.hide();
target = elementUnderCursor(e);
-
- if (that.hint && contains(that.hint[0], target)) {
- that.hint.hide();
+ // IE8 does not return the element in iframe from first attempt
+ if (!target) {
target = elementUnderCursor(e);
- // IE8 does not return the element in iframe from first attempt
- if (!target) {
- target = elementUnderCursor(e);
- }
- that.hint.show();
}
+ hint.show();
+ }
+
+ return target;
+ },
+
+ _withDropTarget: function(element, callback) {
+ var result,
+ group = this.options.group,
+ targets = dropTargets[group],
+ areas = dropAreas[group];
- result = checkTarget(target, targets, areas);
+ if (targets && targets.length || areas && areas.length) {
+ result = checkTarget(element, targets, areas);
if (result) {
callback(result.target, result.targetElement);
@@ -15693,6 +16225,10 @@ var A = 0;
that.userEvents.destroy();
+ this._scrollableParent = null;
+ this._cursorElement = null;
+ clearInterval(this._scrollInterval);
+
that.currentTarget = null;
},
@@ -15723,6 +16259,75 @@ var A = 0;
Movable: Movable
});
+ function scrollableViewPort(element) {
+ var body = document.body,
+ offset,
+ top,
+ left;
+
+ if (element[0] === body) {
+ top = body.scrollTop;
+ left = body.scrollLeft;
+
+ return {
+ top: top,
+ left: left,
+ bottom: top + $window.height(),
+ right: left + $window.width()
+ };
+ } else {
+ offset = element.offset();
+ offset.bottom = offset.top + element.height();
+ offset.right = offset.left + element.width();
+ return offset;
+ }
+ }
+
+ function isRootNode(element) {
+ return element === document.body || element === document.documentElement || element === document;
+ }
+
+ function findScrollableParent(element) {
+ if (!element || isRootNode(element)) {
+ return $(document.body);
+ }
+
+ var parent = $(element)[0];
+
+ while (!kendo.isScrollable(parent) && !isRootNode(parent)) {
+ parent = parent.parentNode;
+ }
+
+ return $(parent);
+ }
+
+ function autoScrollVelocity(mouseX, mouseY, rect) {
+ var velocity = { x: 0, y: 0 };
+
+ var AUTO_SCROLL_AREA = 50;
+
+ if (mouseX - rect.left < AUTO_SCROLL_AREA) {
+ velocity.x = -(AUTO_SCROLL_AREA - (mouseX - rect.left));
+ } else if (rect.right - mouseX < AUTO_SCROLL_AREA) {
+ velocity.x = AUTO_SCROLL_AREA - (rect.right - mouseX);
+ }
+
+ if (mouseY - rect.top < AUTO_SCROLL_AREA) {
+ velocity.y = -(AUTO_SCROLL_AREA - (mouseY - rect.top));
+ } else if (rect.bottom - mouseY < AUTO_SCROLL_AREA) {
+ velocity.y = AUTO_SCROLL_AREA - (rect.bottom - mouseY);
+ }
+
+ return velocity;
+ }
+
+ // export for testing
+ kendo.ui.Draggable.utils = {
+ autoScrollVelocity: autoScrollVelocity,
+ scrollableViewPort: scrollableViewPort,
+ findScrollableParent: findScrollableParent
+ };
+
})(window.kendo.jQuery);
@@ -16621,7 +17226,7 @@ var A = 0;
that.options.hint = defaultHint;
}
- that._draggable = that._createDraggable();
+ that.draggable = that._createDraggable();
},
events: [
@@ -16646,11 +17251,13 @@ var A = 0;
cursorOffset: null,
axis: null,
ignore: null,
- cursor: "auto"
+ autoScroll: false,
+ cursor: "auto",
+ moveOnDragEnter: false
},
destroy: function() {
- this._draggable.destroy();
+ this.draggable.destroy();
Widget.fn.destroy.call(this);
},
@@ -16667,6 +17274,7 @@ var A = 0;
cursorOffset: options.cursorOffset,
axis: options.axis,
ignore: options.ignore,
+ autoScroll: options.autoScroll,
dragstart: $.proxy(that._dragstart, that),
dragcancel: $.proxy(that._dragcancel, that),
drag: $.proxy(that._drag, that),
@@ -16676,7 +17284,6 @@ var A = 0;
_dragstart: function(e) {
var draggedElement = this.draggedElement = e.currentTarget,
- target = e.target || kendo.elementUnderCursor(e),
disabled = this.options.disabled,
handler = this.options.handler,
_placeholder = this.options.placeholder,
@@ -16700,7 +17307,7 @@ var A = 0;
}
},
- _dragcancel: function(e) {
+ _dragcancel: function() {
this._cancel();
this.trigger(CANCEL, { item: this.draggedElement });
@@ -16718,6 +17325,7 @@ var A = 0;
sibling,
getSibling,
axis = this.options.axis,
+ moveOnDragEnter= this.options.moveOnDragEnter,
eventData = { item: draggedElement, list: this, draggableEvent: e };
if(axis === "x" || axis === "y") {
@@ -16745,15 +17353,15 @@ var A = 0;
}
if(this._isFloating(target.element)) { //horizontal
- if(axisDelta.x < 0 && offsetDelta.left < 0) {
+ if(axisDelta.x < 0 && (moveOnDragEnter || offsetDelta.left < 0)) {
direction = "prev";
- } else if(axisDelta.x > 0 && offsetDelta.left > 0) {
+ } else if(axisDelta.x > 0 && (moveOnDragEnter || offsetDelta.left > 0)) {
direction = "next";
}
} else { //vertical
- if(axisDelta.y < 0 && offsetDelta.top < 0) {
+ if(axisDelta.y < 0 && (moveOnDragEnter || offsetDelta.top < 0)) {
direction = "prev";
- } else if(axisDelta.y > 0 && offsetDelta.top > 0) {
+ } else if(axisDelta.y > 0 && (moveOnDragEnter || offsetDelta.top > 0)) {
direction = "next";
}
}
@@ -16819,7 +17427,7 @@ var A = 0;
placeholder.replaceWith(draggedElement);
draggedElement.show();
- this._draggable.dropped = true;
+ this.draggable.dropped = true;
eventData = {
action: this.indexOf(draggedElement) != MISSING_INDEX ? ACTION_SORT : ACTION_REMOVE,
@@ -16866,10 +17474,7 @@ var A = 0;
_findElementUnderCursor: function(e) {
var elementUnderCursor = kendo.elementUnderCursor(e),
- draggable = e.sender,
- disabled = this.options.disabled,
- filter = this.options.filter,
- items = this.items();
+ draggable = e.sender;
if(containsOrEqualTo(draggable.hint[0], elementUnderCursor)) {
draggable.hint.hide();
@@ -17080,7 +17685,6 @@ var A = 0;
Widget = kendo.ui.Widget,
proxy = $.proxy,
abs = Math.abs,
- shift = Array.prototype.shift,
ARIASELECTED = "aria-selected",
SELECTED = "k-state-selected",
ACTIVE = "k-state-selecting",
@@ -17088,7 +17692,7 @@ var A = 0;
CHANGE = "change",
NS = ".kendoSelectable",
UNSELECTING = "k-state-unselecting",
- INPUTSELECTOR = "input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",
+ INPUTSELECTOR = "input,a,textarea,.k-multiselect-wrap,select,button,a.k-button>.k-icon,button.k-button>.k-icon,span.k-icon.k-i-expand,span.k-icon.k-i-collapse",
msie = kendo.support.browser.msie,
supportEventDelegation = false;
@@ -17531,12 +18135,12 @@ var A = 0;
kendo.notify(that);
},
-
+
destroy: function() {
var that = this;
-
+
that.wrapper.off(NS);
-
+
Widget.fn.destroy.call(that);
},
@@ -17795,13 +18399,18 @@ var A = 0;
if (options.pageSizes){
if (!that.element.find(".k-pager-sizes").length){
- $('")
+ var pageSizes = options.pageSizes.length ? options.pageSizes : ["all", 5, 10, 20];
+ var pageItems = $.map(pageSizes, function(size) {
+ if (size.toLowerCase && size.toLowerCase() === "all") {
+ return "";
+ }
+
+ return "";
+ });
+
+ $('")
.appendTo(that.element)
- .find("select")
- .html($.map($.isArray(options.pageSizes) ? options.pageSizes : [5,10,20], function(page){
- return "";
- }).join(""))
- .end()
+ .find("select").html(pageItems.join("")).end()
.appendTo(that.element);
}
@@ -17831,7 +18440,7 @@ var A = 0;
that.element
.on(CLICK + NS , "a", proxy(that._click, that))
- .addClass("k-pager-wrap k-widget");
+ .addClass("k-pager-wrap k-widget k-floatwrap");
that.element.on(CLICK + NS , ".k-current-page", proxy(that._toggleActive, that));
@@ -17873,6 +18482,7 @@ var A = 0;
pageSizes: false,
refresh: false,
messages: {
+ allPages: "All",
display: "{0} - {1} of {2} items",
empty: "No items to display",
page: "Page",
@@ -17985,12 +18595,20 @@ var A = 0;
}
if (options.pageSizes) {
+ var hasAll = that.element.find(".k-pager-sizes option[value='all']").length > 0;
+ var selectAll = hasAll && pageSize === this.dataSource.total();
+ var text = pageSize;
+ if (selectAll) {
+ pageSize = "all";
+ text = options.messages.allPages;
+ }
+
that.element
.find(".k-pager-sizes select")
.val(pageSize)
.filter("[" + kendo.attr("role") + "=dropdownlist]")
.kendoDropDownList("value", pageSize)
- .kendoDropDownList("text", pageSize); // handles custom values
+ .kendoDropDownList("text", text); // handles custom values
}
},
@@ -18016,14 +18634,18 @@ var A = 0;
},
_change: function(e) {
- var pageSize = parseInt(e.currentTarget.value, 10);
+ var value = e.currentTarget.value;
+ var pageSize = parseInt(value, 10);
+ var dataSource = this.dataSource;
if (!isNaN(pageSize)){
- this.dataSource.pageSize(pageSize);
+ dataSource.pageSize(pageSize);
+ } else if ((value + "").toLowerCase() == "all") {
+ dataSource.pageSize(dataSource.total());
}
},
- _toggleActive: function(e) {
+ _toggleActive: function() {
this.list.toggleClass("k-state-expanded");
},
@@ -18038,7 +18660,7 @@ var A = 0;
},
totalPages: function() {
- return Math.ceil((this.dataSource.total() || 0) / this.pageSize());
+ return Math.ceil((this.dataSource.total() || 0) / (this.pageSize() || 1));
},
pageSize: function() {
@@ -18073,7 +18695,6 @@ var A = 0;
Widget = ui.Widget,
support = kendo.support,
getOffset = kendo.getOffset,
- activeElement = kendo._activeElement,
OPEN = "open",
CLOSE = "close",
DEACTIVATE = "deactivate",
@@ -18266,8 +18887,7 @@ var A = 0;
if (!options.modal) {
DOCUMENT_ELEMENT.unbind(that.downEvent, that._mousedownProxy);
- that._scrollableParents().unbind(SCROLL, that._resizeProxy);
- WINDOW.unbind(RESIZE_SCROLL, that._resizeProxy);
+ that._toggleResize(false);
}
kendo.destroy(that.element.children());
@@ -18315,11 +18935,8 @@ var A = 0;
// this binding hangs iOS in editor
if (!(support.mobileOS.ios || support.mobileOS.android)) {
// all elements in IE7/8 fire resize event, causing mayhem
- that._scrollableParents()
- .unbind(SCROLL, that._resizeProxy)
- .bind(SCROLL, that._resizeProxy);
- WINDOW.unbind(RESIZE_SCROLL, that._resizeProxy)
- .bind(RESIZE_SCROLL, that._resizeProxy);
+ that._toggleResize(false);
+ that._toggleResize(true);
}
}
@@ -18364,6 +18981,12 @@ var A = 0;
}
},
+ position: function() {
+ if (this.visible()) {
+ this._position();
+ }
+ },
+
toggle: function() {
var that = this;
@@ -18382,7 +19005,10 @@ var A = 0;
if (that.visible()) {
wrap = (that.wrapper[0] ? that.wrapper : kendo.wrap(that.element).hide());
+ that._toggleResize(false);
+
if (that._closing || that._trigger(CLOSE)) {
+ that._toggleResize(true);
return;
}
@@ -18397,8 +19023,6 @@ var A = 0;
});
DOCUMENT_ELEMENT.unbind(that.downEvent, that._mousedownProxy);
- that._scrollableParents().unbind(SCROLL, that._resizeProxy);
- WINDOW.unbind(RESIZE_SCROLL, that._resizeProxy);
if (skipEffects) {
animation = { hide: true, effects: {} };
@@ -18441,6 +19065,13 @@ var A = 0;
}
},
+ _toggleResize: function(toggle) {
+ var method = toggle ? "on" : "off";
+
+ this._scrollableParents()[method](SCROLL, this._resizeProxy);
+ WINDOW[method](RESIZE_SCROLL, this._resizeProxy);
+ },
+
_mousedown: function(e) {
var that = this,
container = that.element[0],
@@ -18500,14 +19131,14 @@ var A = 0;
return $(this.options.anchor)
.parentsUntil("body")
.filter(function(index, element) {
- var computedStyle = kendo.getComputedStyles(element, ["overflow"]);
- return computedStyle.overflow != "visible";
+ return kendo.isScrollable(element);
});
},
_position: function(fixed) {
var that = this,
- element = that.element.css(POSITION, ""),
+ //element = that.element.css(POSITION, ""), /* fixes telerik/kendo-ui-core#790, comes from telerik/kendo#615 */
+ element = that.element,
wrapper = that.wrapper,
options = that.options,
viewport = $(options.viewport),
@@ -18520,12 +19151,18 @@ var A = 0;
siblingContainer, parents,
parentZIndex, zIndex = 10002,
isWindow = !!((viewport[0] == window) && window.innerWidth && (zoomLevel <= 1.02)),
- idx = 0, length, viewportWidth, viewportHeight;
+ idx = 0,
+ docEl = document.documentElement,
+ length, viewportWidth, viewportHeight;
// $(window).height() uses documentElement to get the height
viewportWidth = isWindow ? window.innerWidth : viewport.width();
viewportHeight = isWindow ? window.innerHeight : viewport.height();
+ if (isWindow && docEl.scrollHeight - docEl.clientHeight > 0) {
+ viewportWidth -= kendo.support.scrollbar();
+ }
+
siblingContainer = anchor.parents().filter(wrapper.siblings());
if (siblingContainer[0]) {
@@ -18719,7 +19356,7 @@ var A = 0;
that._compileTemplates(options.templates);
that._guid = "_" + kendo.guid();
that._isRtl = kendo.support.isRtl(element);
- that._compileStacking(options.stacking, options.position.top);
+ that._compileStacking(options.stacking, options.position.top, options.position.left);
kendo.notify(that);
},
@@ -18780,15 +19417,16 @@ var A = 0;
return type ? that._compiled[type] || defaultCompiled : defaultCompiled;
},
- _compileStacking: function(stacking, top) {
+ _compileStacking: function(stacking, top, left) {
var that = this,
paddings = { paddingTop: 0, paddingRight: 0, paddingBottom: 0, paddingLeft: 0 },
+ horizontalAlignment = left !== null ? LEFT : RIGHT,
origin, position;
switch (stacking) {
case "down":
- origin = BOTTOM + " " + LEFT;
- position = TOP + " " + LEFT;
+ origin = BOTTOM + " " + horizontalAlignment;
+ position = TOP + " " + horizontalAlignment;
delete paddings.paddingBottom;
break;
case RIGHT:
@@ -18802,18 +19440,18 @@ var A = 0;
delete paddings.paddingLeft;
break;
case UP:
- origin = TOP + " " + LEFT;
- position = BOTTOM + " " + LEFT;
+ origin = TOP + " " + horizontalAlignment;
+ position = BOTTOM + " " + horizontalAlignment;
delete paddings.paddingTop;
break;
default:
if (top !== null) {
- origin = BOTTOM + " " + LEFT;
- position = TOP + " " + LEFT;
+ origin = BOTTOM + " " + horizontalAlignment;
+ position = TOP + " " + horizontalAlignment;
delete paddings.paddingBottom;
} else {
- origin = TOP + " " + LEFT;
- position = BOTTOM + " " + LEFT;
+ origin = TOP + " " + horizontalAlignment;
+ position = BOTTOM + " " + horizontalAlignment;
delete paddings.paddingTop;
}
break;
@@ -18831,13 +19469,22 @@ var A = 0;
closeIcon;
function attachClick(target) {
- target.on(CLICK + NS, function() {
- popup.close();
+ target.on(CLICK + NS, function () {
+ that._hidePopup(popup);
+ });
+ }
+
+ if (popup.options.anchor !== document.body && popup.options.origin.indexOf(RIGHT) > 0) {
+ popup.bind("open", function () {
+ var shadows = kendo.getShadows(popup.element);
+ setTimeout(function () {
+ popup.wrapper.css("left", parseFloat(popup.wrapper.css("left")) + shadows.left + shadows.right);
+ });
});
}
if (options.hideOnClick) {
- popup.bind("activate", function(e) {
+ popup.bind("activate", function() {
if (attachDelay) {
setTimeout(function(){
attachClick(popup.element);
@@ -18863,10 +19510,9 @@ var A = 0;
autoHideAfter = options.autoHideAfter,
x = options.position.left,
y = options.position.top,
- allowHideAfter = options.allowHideAfter,
- popup, openPopup, attachClick, closeIcon;
+ popup, openPopup;
- openPopup = $("." + that._guid).last();
+ openPopup = $("." + that._guid + ":not(.k-hiding)").last();
popup = new kendo.ui.Popup(wrapper, {
anchor: openPopup[0] ? openPopup : document.body,
@@ -18876,7 +19522,7 @@ var A = 0;
modal: true,
collision: "",
isRtl: that._isRtl,
- close: function(e) {
+ close: function() {
that._triggerHide(this.element);
},
deactivate: function(e) {
@@ -18914,12 +19560,17 @@ var A = 0;
}
if (autoHideAfter > 0) {
- setTimeout(function(){
- popup.close();
+ setTimeout(function () {
+ that._hidePopup(popup);
}, autoHideAfter);
}
},
+ _hidePopup: function (popup) {
+ popup.wrapper.addClass("k-hiding");
+ popup.close();
+ },
+
_togglePin: function(wrapper, pin) {
var win = $(window),
sign = pin ? -1 : 1;
@@ -18962,8 +19613,7 @@ var A = 0;
var that = this,
autoHideAfter = options.autoHideAfter,
animation = options.animation,
- insertionMethod = options.stacking == UP || options.stacking == LEFT ? "prependTo" : "appendTo",
- attachClick;
+ insertionMethod = options.stacking == UP || options.stacking == LEFT ? "prependTo" : "appendTo";
wrapper
.addClass(that._guid)
@@ -18999,7 +19649,7 @@ var A = 0;
var that = this,
options = that.options,
wrapper = $(WRAPPER),
- args, defaultArgs, popup;
+ args, defaultArgs;
if (!type) {
type = INFO;
@@ -19073,7 +19723,7 @@ var A = 0;
openedNotifications.each(function(idx, element){
var popup = $(element).data("kendoPopup");
if (popup) {
- popup.close();
+ that._hidePopup(popup);
}
});
}
@@ -19105,7 +19755,7 @@ var A = 0;
}
if (newOptions.stacking !== undefined || newOptions.position !== undefined) {
- that._compileStacking(options.stacking, options.position.top);
+ that._compileStacking(options.stacking, options.position.top, options.position.left);
}
},
@@ -19538,6 +20188,8 @@ var A = 0;
popup.destroy();
}
+ clearTimeout(this.timeout);
+
this.element.off(NS);
DOCUMENT.off("keydown" + NS, this._documentKeyDownHandler);
@@ -19559,6 +20211,7 @@ var A = 0;
Widget = kendo.ui.Widget,
proxy = $.proxy,
isFunction = kendo.isFunction,
+ keys = kendo.keys,
TOOLBAR = "k-toolbar",
BUTTON = "k-button",
@@ -19572,6 +20225,7 @@ var A = 0;
RESIZABLE_TOOLBAR = "k-toolbar-resizable",
STATE_ACTIVE = "k-state-active",
STATE_DISABLED = "k-state-disabled",
+ STATE_HIDDEN = "k-state-hidden",
GROUP_START = "k-group-start",
GROUP_END = "k-group-end",
PRIMARY = "k-primary",
@@ -19601,339 +20255,684 @@ var A = 0;
OVERFLOW_ALWAYS = "always",
OVERFLOW_HIDDEN = "k-overflow-hidden",
- KENDO_UID_ATTR = kendo.attr("uid"),
+ KENDO_UID_ATTR = kendo.attr("uid");
- template = kendo.template,
- components = {
- button: {
- base: createButton,
- toolbar: createToolbarButton,
- overflow: createOverflowButton
+ kendo.toolbar = {};
+
+ var components = {
+ overflowAnchor: '',
+ overflowContainer: ''
+ };
+
+ kendo.toolbar.registerComponent = function(name, toolbar, overflow) {
+ components[name] = {
+ toolbar: toolbar,
+ overflow: overflow
+ };
+ };
+
+ var Item = kendo.Class.extend({
+ addOverflowAttr: function() {
+ this.element.attr(kendo.attr("overflow"), this.options.overflow || OVERFLOW_AUTO);
},
- buttonGroup: {
- base: function (options, initializer, element) {
- var items = options.buttons,
- item;
+ addUidAttr: function() {
+ this.element.attr(KENDO_UID_ATTR, this.options.uid);
+ },
- if (!items) {
- return;
- }
+ addIdAttr: function() {
+ if (this.options.id) {
+ this.element.attr("id", this.options.id);
+ }
+ },
- if (options.attributes) {
- element.attr(options.attributes);
- }
+ addOverflowIdAttr: function() {
+ if (this.options.id) {
+ this.element.attr("id", this.options.id + "_overflow");
+ }
+ },
- element.data({ type: "buttonGroup" });
- element.attr(KENDO_UID_ATTR, options.uid);
+ attributes: function() {
+ if (this.options.attributes) {
+ this.element.attr(this.options.attributes);
+ }
+ },
- for (var i = 0; i < items.length; i++) {
- if (!items[i].uid) {
- items[i].uid = kendo.guid();
- }
- item = initializer($.extend({mobile: options.mobile}, items[i]));
- item.appendTo(element);
- }
+ show: function() {
+ this.element.removeClass(STATE_HIDDEN).show();
+ this.options.hidden = false;
+ },
- element.children().first().addClass(GROUP_START);
- element.children().last().addClass(GROUP_END);
- },
- toolbar: function (options) {
- var element = $('');
+ hide: function() {
+ this.element.addClass(STATE_HIDDEN).hide();
+ this.options.hidden = true;
+ },
- components.buttonGroup.base(options, components.button.toolbar, element);
+ remove: function() {
+ this.element.remove();
+ },
- element.addClass(BUTTON_GROUP);
+ enable: function(isEnabled) {
+ if (isEnabled === undefined) {
+ isEnabled = true;
+ }
+ this.element.toggleClass(STATE_DISABLED, !isEnabled);
+ this.options.enable = isEnabled;
+ },
- if (options.align) {
- element.addClass("k-align-" + options.align);
+ twin: function() {
+ var uid = this.element.attr(KENDO_UID_ATTR);
+ if (this.overflow) {
+ return this.toolbar
+ .element
+ .find("[" + KENDO_UID_ATTR + "='" + uid + "']")
+ .data(this.options.type);
+ } else if (this.toolbar.options.resizable) {
+ return this.toolbar
+ .popup.element
+ .find("[" + KENDO_UID_ATTR + "='" + uid + "']")
+ .data(this.options.type);
+ }
+ }
+ });
+
+ kendo.toolbar.Item = Item;
+
+ var Button = Item.extend({
+ init: function(options, toolbar) {
+ var element = options.useButtonTag ? $('') : $('');
+
+ this.element = element;
+ this.options = options;
+ this.toolbar = toolbar;
+
+ this.attributes();
+
+ if (options.primary) {
+ element.addClass(PRIMARY);
+ }
+
+ if (options.togglable) {
+ element.addClass(TOGGLE_BUTTON);
+ this.toggle(options.selected);
+ }
+
+ if (options.url !== undefined && !options.useButtonTag) {
+ element.attr("href", options.url);
+ if (options.mobile) {
+ element.attr(kendo.attr("role"), "button");
}
+ }
- if (options.id) {
- element.attr("id", options.id);
+ if (options.group) {
+ element.attr(kendo.attr("group"), options.group);
+ if ((this.overflow && this.options.overflow === OVERFLOW_ALWAYS) || !this.overflow) {
+ this.group = this.toolbar.addToGroup(this, options.group);
}
+ }
- return element;
- },
- overflow: function (options) {
- var element = $('');
+ if (!options.togglable && options.click && isFunction(options.click)) {
+ this.clickHandler = options.click;
+ }
- components.buttonGroup.base(options, components.button.overflow, element);
+ if (options.togglable && options.toggle && isFunction(options.toggle)) {
+ this.toggleHandler = options.toggle;
+ }
+ },
- element.addClass((options.mobile ? "" : BUTTON_GROUP) + " k-overflow-group");
+ toggle: function(state, propagate) {
+ state = !!state;
- if (options.id) {
- element.attr("id", options.id + "_overflow");
- }
+ if (this.group && state) {
+ this.group.select(this);
+ } else if (!this.group) {
+ this.select(state);
+ }
- return element;
+ if (propagate && this.twin()) {
+ this.twin().toggle(state);
}
},
- splitButton: {
- toolbar: function(options) {
- var element = $(''),
- mainButton = components.button.toolbar(options),
- arrowButton = $(''),
- popupElement = $(''),
- popup,
- items = options.menuButtons,
- item;
+ getParentGroup: function() {
+ if (this.options.isChild) {
+ return this.element.closest("." + BUTTON_GROUP).data("buttonGroup");
+ }
+ },
- mainButton.appendTo(element);
- arrowButton.appendTo(element);
- popupElement.appendTo(element);
+ _addGraphics: function() {
+ var element = this.element,
+ icon = this.options.icon,
+ spriteCssClass = this.options.spriteCssClass,
+ imageUrl = this.options.imageUrl,
+ isEmpty, span, img;
- for (var i = 0; i < items.length; i++) {
- item = components.button.toolbar($.extend({mobile: options.mobile, click: options.click}, items[i]));
- item.wrap("").parent().appendTo(popupElement);
- }
+ if (spriteCssClass || imageUrl || icon) {
+ isEmpty = true;
- if (options.align) {
- element.addClass("k-align-" + options.align);
+ element.contents().not("span.k-sprite,span." + ICON + ",img.k-image").each(function(idx, el){
+ if (el.nodeType == 1 || el.nodeType == 3 && $.trim(el.nodeValue).length > 0) {
+ isEmpty = false;
+ }
+ });
+
+ if (isEmpty) {
+ element.addClass(BUTTON_ICON);
+ } else {
+ element.addClass(BUTTON_ICON_TEXT);
}
+ }
- if (!options.id) {
- options.id = options.uid;
+ if (icon) {
+ span = element.children("span." + ICON).first();
+ if (!span[0]) {
+ span = $('').prependTo(element);
+ }
+ span.addClass(ICON_PREFIX + icon);
+ } else if (spriteCssClass) {
+ span = element.children("span.k-sprite").first();
+ if (!span[0]) {
+ span = $('').prependTo(element);
}
+ span.addClass(spriteCssClass);
+ } else if (imageUrl) {
+ img = element.children("img.k-image").first();
+ if (!img[0]) {
+ img = $('').prependTo(element);
+ }
+ img.attr("src", imageUrl);
+ }
+ }
+ });
- element.attr("id", options.id + "_wrapper");
- popupElement.attr("id", options.id + "_optionlist")
- .attr(KENDO_UID_ATTR, options.rootUid);
+ kendo.toolbar.Button = Button;
- if (options.mobile) {
- popupElement = actionSheetWrap(popupElement);
- }
+ var ToolBarButton = Button.extend({
+ init: function(options, toolbar) {
+ Button.fn.init.call(this, options, toolbar);
- popup = popupElement.kendoPopup({
- appendTo: options.mobile ? $(options.mobile).children(".km-pane") : null,
- anchor: element,
- copyAnchorStyles: false,
- animation: options.animation,
- open: adjustPopupWidth
- }).data("kendoPopup");
+ var element = this.element;
- element.data({
- type: "splitButton",
- kendoPopup: popup
- });
- element.attr(KENDO_UID_ATTR, options.uid);
+ element.addClass(BUTTON);
- return element;
- },
- overflow: function(options) {
- var element = $(''),
- mainButton = components.button.overflow(options),
- items = options.menuButtons,
- item;
+ this.addIdAttr();
- mainButton.appendTo(element);
+ if (options.align) {
+ element.addClass("k-align-" + options.align);
+ }
- for (var i = 0; i < items.length; i++) {
- item = components.button.overflow($.extend({mobile: options.mobile}, items[i]));
- item.appendTo(element);
+ if (options.showText != "overflow" && options.text) {
+ if (options.mobile) {
+ element.html('' + options.text + "");
+ } else {
+ element.html(options.text);
}
+ }
+
+ options.hasIcon = (options.showIcon != "overflow") && (options.icon || options.spriteCssClass || options.imageUrl);
+ if (options.hasIcon) {
+ this._addGraphics();
+ }
- element.data({ type: "splitButton" });
- element.attr(KENDO_UID_ATTR, options.uid);
+ this.addUidAttr();
+ this.addOverflowAttr();
+ this.enable(options.enable);
- return element;
+ if (options.hidden) {
+ this.hide();
}
+
+ this.element.data({
+ type: "button",
+ button: this
+ });
},
- separator: {
- base: function(options, overflow) {
- var element = overflow ? $(' ') : $('
');
- element.data({ type: "separator" });
- element.attr(KENDO_UID_ATTR, options.uid);
+ select: function(selected) {
+ if (selected === undefined) {
+ selected = false;
+ }
- if (options.attributes) {
- element.attr(options.attributes);
- }
+ this.element.toggleClass(STATE_ACTIVE, selected);
+ this.options.selected = selected;
+ }
+ });
- element.addClass(SEPARATOR);
+ kendo.toolbar.ToolBarButton = ToolBarButton;
- return element;
- },
- toolbar: function(options) {
- var element = components.separator.base(options, false);
+ var OverflowButton = Button.extend({
+ init: function(options, toolbar) {
+ this.overflow = true;
- if (options.id) {
- element.attr("id", options.id);
- }
+ Button.fn.init.call(this, options, toolbar);
- return element;
- },
- overflow: function(options) {
- var element = components.separator.base(options, true);
+ var element = this.element;
- if (options.id) {
- element.attr("id", options.id + "_overflow");
+ element.addClass(OVERFLOW_BUTTON + " " + BUTTON);
+
+ if (options.showText != "toolbar" && options.text) {
+ if (options.mobile) {
+ element.html('' + options.text + "");
+ } else {
+ element.html('' + options.text + "");
}
+ }
- return element;
+ options.hasIcon = (options.showIcon != "toolbar") && (options.icon || options.spriteCssClass || options.imageUrl);
+ if (options.hasIcon) {
+ this._addGraphics();
}
- },
- overflowAnchor: '',
+ if (!options.isChild) {
+ this._wrap();
+ }
- overflowContainer: ''
- };
+ this.addOverflowIdAttr();
+ this.attributes();
+ this.addUidAttr();
+ this.addOverflowAttr();
+ this.enable(options.enable);
- function createButton(options) {
- var element = options.useButtonTag ? $('') : $('');
+ if (options.hidden) {
+ this.hide();
+ }
- element.data({ type: "button" });
- element.attr(KENDO_UID_ATTR, options.uid);
+ this.element.data({
+ type: "button",
+ button: this
+ });
+ },
- if (options.attributes) {
- element.attr(options.attributes);
- }
+ _wrap: function() {
+ this.element = this.element.wrap("").parent();
+ },
+
+ overflowHidden: function() {
+ this.element.addClass(OVERFLOW_HIDDEN);
+ },
- if (options.togglable) {
- element.addClass(TOGGLE_BUTTON);
- if (options.selected) {
- element.addClass(STATE_ACTIVE);
+ select: function(selected) {
+ if (selected === undefined) {
+ selected = false;
}
- }
- if (options.enable === false) {
- element.addClass(STATE_DISABLED);
+ if (this.options.isChild) {
+ this.element.toggleClass(STATE_ACTIVE, selected);
+ } else {
+ this.element.find(".k-button").toggleClass(STATE_ACTIVE, selected);
+ }
+ this.options.selected = selected;
}
+ });
- if (options.url !== undefined && !options.useButtonTag) {
- element.attr("href", options.url);
- if (options.mobile) {
- element.attr(kendo.attr("role"), "button");
+ kendo.toolbar.OverflowButton = OverflowButton;
+ kendo.toolbar.registerComponent("button", ToolBarButton, OverflowButton);
+
+ var ButtonGroup = Item.extend({
+ createButtons: function(buttonConstructor) {
+ var options = this.options;
+ var items = options.buttons || [];
+ var item;
+
+ for (var i = 0; i < items.length; i++) {
+ if (!items[i].uid) {
+ items[i].uid = kendo.guid();
+ }
+ item = new buttonConstructor($.extend({ mobile: options.mobile, isChild: true, type: "button" }, items[i]), this.toolbar);
+ item.element.appendTo(this.element);
}
- }
+ },
- if (options.group) {
- element.attr(kendo.attr("group"), options.group);
+ refresh: function() {
+ this.element.children().filter(":not('." + STATE_HIDDEN + "'):first").addClass(GROUP_START);
+ this.element.children().filter(":not('." + STATE_HIDDEN + "'):last").addClass(GROUP_END);
}
+ });
- if (!options.togglable && options.click && isFunction(options.click)) {
- element.data("click", options.click);
- }
+ kendo.toolbar.ButtonGroup = ButtonGroup;
- if (options.togglable && options.toggle && isFunction(options.toggle)) {
- element.data("toggle", options.toggle);
- }
+ var ToolBarButtonGroup = ButtonGroup.extend({
+ init: function(options, toolbar) {
+ var element = this.element = $('');
+ this.options = options;
+ this.toolbar = toolbar;
- return element;
- }
+ this.addIdAttr();
- function createToolbarButton(options) {
- var element = components.button.base(options),
- hasIcon;
+ if (options.align) {
+ element.addClass("k-align-" + options.align);
+ }
- element.addClass(BUTTON);
+ this.createButtons(ToolBarButton);
+ this.attributes();
+ this.addUidAttr();
+ this.addOverflowAttr();
+ this.refresh();
- if (options.primary) {
- element.addClass(PRIMARY);
- }
+ element.addClass(BUTTON_GROUP);
- if (options.align) {
- element.addClass("k-align-" + options.align);
+ this.element.data({
+ type: "buttonGroup",
+ buttonGroup: this
+ });
}
+ });
+
+ kendo.toolbar.ToolBarButtonGroup = ToolBarButtonGroup;
+
+ var OverflowButtonGroup = ButtonGroup.extend({
+ init: function(options, toolbar) {
+ var element = this.element = $('');
+ this.options = options;
+ this.toolbar = toolbar;
+ this.overflow = true;
+
+ this.addOverflowIdAttr();
- if (options.id) {
- element.attr("id", options.id);
+ this.createButtons(OverflowButton);
+ this.attributes();
+ this.addUidAttr();
+ this.addOverflowAttr();
+ this.refresh();
+
+ element.addClass((options.mobile ? "" : BUTTON_GROUP) + " k-overflow-group");
+
+ this.element.data({
+ type: "buttonGroup",
+ buttonGroup: this
+ });
+ },
+
+ overflowHidden: function() {
+ this.element.addClass(OVERFLOW_HIDDEN);
}
+ });
+
+ kendo.toolbar.OverflowButtonGroup = OverflowButtonGroup;
+ kendo.toolbar.registerComponent("buttonGroup", ToolBarButtonGroup, OverflowButtonGroup);
+
+ var ToolBarSplitButton = Item.extend({
+ init: function(options, toolbar) {
+ var element = this.element = $('');
+
+ this.options = options;
+ this.toolbar = toolbar;
+
+ this.mainButton = new ToolBarButton(options, toolbar);
+ this.arrowButton = $('');
+ this.popupElement = $('');
+
+ this.mainButton.element
+ .removeAttr("href tabindex")
+ .appendTo(element);
+
+ this.arrowButton.appendTo(element);
+ this.popupElement.appendTo(element);
+
+ if (options.align) {
+ element.addClass("k-align-" + options.align);
+ }
+
+ if (!options.id) {
+ options.id = options.uid;
+ }
+
+ element.attr("id", options.id + "_wrapper");
+
+ this.addOverflowAttr();
+ this.addUidAttr();
+
+ this.createMenuButtons();
+ this.createPopup();
+ this._navigatable();
+
+ this.mainButton.main = true;
+
+ element.data({
+ type: "splitButton",
+ splitButton: this,
+ kendoPopup: this.popup
+ });
+ },
+
+ _navigatable: function() {
+ var that = this;
+
+ that.popupElement.on("keydown", "." + BUTTON, function(e) {
+ var li = $(e.target).parent();
+
+ e.preventDefault();
+
+ if (e.keyCode === keys.ESC || e.keyCode === keys.TAB || (e.altKey && e.keyCode === keys.UP)) {
+ that.toggle();
+ that.focus();
+ } else if (e.keyCode === keys.DOWN) {
+ findFocusableSibling(li, "next").focus();
+ } else if (e.keyCode === keys.UP) {
+ findFocusableSibling(li, "prev").focus();
+ } else if (e.keyCode === keys.SPACEBAR || e.keyCode === keys.ENTER) {
+ that.toolbar.userEvents.trigger("tap", { target: $(e.target) });
+ }
+ });
+ },
+
+ createMenuButtons: function() {
+ var options = this.options;
+ var items = options.menuButtons;
+ var item;
+
+ for (var i = 0; i < items.length; i++) {
+ item = new ToolBarButton($.extend({ mobile: options.mobile, type: "button", click: options.click }, items[i]), this.toolbar);
+ item.element.wrap("").parent().appendTo(this.popupElement);
+ }
+ },
+
+ createPopup: function() {
+ var options = this.options;
+ var element = this.element;
+
+ this.popupElement
+ .attr("id", options.id + "_optionlist")
+ .attr(KENDO_UID_ATTR, options.rootUid);
- if (options.showText != "overflow" && options.text) {
if (options.mobile) {
- element.html('' + options.text + "");
- } else {
- element.html(options.text);
+ this.popupElement = actionSheetWrap(this.popupElement);
}
- }
- hasIcon = (options.showIcon != "overflow") && (options.icon || options.spriteCssClass || options.imageUrl);
+ this.popup = this.popupElement.kendoPopup({
+ appendTo: options.mobile ? $(options.mobile).children(".km-pane") : null,
+ anchor: element,
+ isRtl: this.toolbar._isRtl,
+ copyAnchorStyles: false,
+ animation: options.animation,
+ open: adjustPopupWidth,
+ activate: function() {
+ this.element.find(":kendoFocusable").first().focus();
+ },
+ close: function() {
+ element.focus();
+ }
+ }).data("kendoPopup");
- if (hasIcon) {
- addGraphic(options, element);
- }
+ this.popup.element.on(CLICK, "a.k-button", preventClick);
+ },
- return element;
- }
+ remove: function() {
+ this.popup.element.off(CLICK, "a.k-button");
+ this.popup.destroy();
+ this.element.remove();
+ },
- function createOverflowButton(options) {
- var element = components.button.base(options),
- hasIcon;
+ toggle: function() {
+ this.popup.toggle();
+ },
- element.addClass(OVERFLOW_BUTTON + " " + BUTTON);
+ enable: function(isEnabled) {
+ if (isEnabled === undefined) {
+ isEnabled = true;
+ }
+ this.mainButton.enable(isEnabled);
+ this.options.enable = isEnabled;
+ },
- if (options.primary) {
- element.addClass(PRIMARY);
+ focus: function() {
+ this.element.focus();
}
+ });
- if (options.id) {
- element.attr("id", options.id + "_overflow");
- }
+ kendo.toolbar.ToolBarSplitButton = ToolBarSplitButton;
- if (options.showText != "toolbar" && options.text) {
- if (options.mobile) {
- element.html('' + options.text + "");
- } else {
- element.html(options.text);
+ var OverflowSplitButton = Item.extend({
+ init: function(options, toolbar) {
+ var element = this.element = $(''),
+ items = options.menuButtons,
+ item;
+
+ this.options = options;
+ this.toolbar = toolbar;
+ this.overflow = true;
+
+ this.mainButton = new OverflowButton($.extend({ isChild: true }, options));
+ this.mainButton.element.appendTo(element);
+
+ for (var i = 0; i < items.length; i++) {
+ item = new OverflowButton($.extend({ mobile: options.mobile, isChild: true }, items[i]), this.toolbar);
+ item.element.appendTo(element);
}
+
+ this.addUidAttr();
+ this.addOverflowAttr();
+
+ this.mainButton.main = true;
+
+ element.data({
+ type: "splitButton",
+ splitButton: this
+ });
+ },
+
+ overflowHidden: function() {
+ this.element.addClass(OVERFLOW_HIDDEN);
}
+ });
+
+ kendo.toolbar.OverflowSplitButton = OverflowSplitButton;
+ kendo.toolbar.registerComponent("splitButton", ToolBarSplitButton, OverflowSplitButton);
- hasIcon = (options.showIcon != "toolbar") && (options.icon || options.spriteCssClass || options.imageUrl);
+ var ToolBarSeparator = Item.extend({
+ init: function(options, toolbar) {
+ var element = this.element = $('
');
- if (hasIcon) {
- addGraphic(options, element);
+ this.element = element;
+ this.options = options;
+ this.toolbar = toolbar;
+
+ this.attributes();
+ this.addIdAttr();
+ this.addUidAttr();
+ this.addOverflowAttr();
+
+ element.addClass(SEPARATOR);
+
+ element.data({
+ type: "separator",
+ separator: this
+ });
}
+ });
- return element;
- }
+ var OverflowSeparator = Item.extend({
+ init: function(options, toolbar) {
+ var element = this.element = $(' ');
- function addGraphic(options, element) {
- var icon = options.icon,
- spriteCssClass = options.spriteCssClass,
- imageUrl = options.imageUrl,
- isEmpty, span, img;
+ this.element = element;
+ this.options = options;
+ this.toolbar = toolbar;
+ this.overflow = true;
- if (spriteCssClass || imageUrl || icon) {
- isEmpty = true;
+ this.attributes();
+ this.addUidAttr();
+ this.addOverflowIdAttr();
- element.contents().not("span.k-sprite,span." + ICON + ",img.k-image").each(function(idx, el){
- if (el.nodeType == 1 || el.nodeType == 3 && $.trim(el.nodeValue).length > 0) {
- isEmpty = false;
- }
+ element.addClass(SEPARATOR);
+
+ element.data({
+ type: "separator",
+ separator: this
});
+ },
- if (isEmpty) {
- element.addClass(BUTTON_ICON);
+ overflowHidden: function() {
+ this.element.addClass(OVERFLOW_HIDDEN);
+ }
+ });
+
+ kendo.toolbar.registerComponent("separator", ToolBarSeparator, OverflowSeparator);
+
+ var TemplateItem = Item.extend({
+ init: function(template, options, toolbar) {
+ var element = isFunction(template) ? template(options) : template;
+
+ if (!(element instanceof jQuery)) {
+ element = $("").html(element);
} else {
- element.addClass(BUTTON_ICON_TEXT);
+ element = element.wrap("").parent();
}
+
+ this.element = element;
+ this.options = options;
+ this.options.type = "template";
+ this.toolbar = toolbar;
+
+ this.attributes();
+ this.addUidAttr();
+ this.addIdAttr();
+ this.addOverflowAttr();
+
+ element.data({
+ type: "template",
+ template: this
+ });
}
+ });
- if (icon) {
- span = element.children("span." + ICON).first();
- if (!span[0]) {
- span = $('').prependTo(element);
- }
- span.addClass(ICON_PREFIX + icon);
- } else if (spriteCssClass) {
- span = element.children("span.k-sprite").first();
- if (!span[0]) {
- span = $('').prependTo(element);
- }
- span.addClass(spriteCssClass);
- } else if (imageUrl) {
- img = element.children("img.k-image").first();
- if (!img[0]) {
- img = $('').prependTo(element);
+ kendo.toolbar.TemplateItem = TemplateItem;
+
+ var OverflowTemplateItem = Item.extend({
+ init: function(template, options, toolbar) {
+ var element = isFunction(template) ? $(template(options)) : $(template);
+
+ if (!(element instanceof jQuery)) {
+ element = $("").html(element);
+ } else {
+ element = element.wrap("").parent();
}
- img.attr("src", imageUrl);
+
+ this.element = element;
+ this.options = options;
+ this.options.type = "template";
+ this.toolbar = toolbar;
+ this.overflow = true;
+
+ this.attributes();
+ this.addUidAttr();
+ this.addOverflowIdAttr();
+ this.addOverflowAttr();
+
+ element.data({
+ type: "template",
+ template: this
+ });
+ },
+
+ overflowHidden: function() {
+ this.element.addClass(OVERFLOW_HIDDEN);
}
- }
+ });
+
+ kendo.toolbar.OverflowTemplateItem = OverflowTemplateItem;
- function adjustPopupWidth(e) {
+ function adjustPopupWidth() {
var anchor = this.options.anchor,
computedWidth = anchor.outerWidth(),
width;
@@ -19970,6 +20969,46 @@ var A = 0;
e.preventDefault();
}
+ function findFocusableSibling (element, dir) {
+ var getSibling = dir === "next" ? $.fn.next : $.fn.prev;
+ var getter = dir === "next" ? $.fn.first : $.fn.last;
+ var candidate = getSibling.call(element);
+
+ if (candidate.is(":kendoFocusable") || !candidate.length) {
+ return candidate;
+ }
+
+ if (candidate.find(":kendoFocusable").length) {
+ return getter.call(candidate.find(":kendoFocusable"));
+ }
+
+ return findFocusableSibling(candidate, dir);
+ }
+
+ var Group = Class.extend({
+ init: function(name) {
+ this.name = name;
+ this.buttons = [];
+ },
+
+ add: function(button) {
+ this.buttons[this.buttons.length] = button;
+ },
+
+ remove: function(button) {
+ var index = $.inArray(button, this.buttons);
+ this.buttons.splice(index, 1);
+ },
+
+ select: function(button) {
+ for (var i = 0; i < this.buttons.length; i ++) {
+ this.buttons[i].select(false);
+ }
+
+ button.select(true);
+ }
+ });
+
var ToolBar = Widget.extend({
init: function(element, options) {
var that = this;
@@ -19982,6 +21021,8 @@ var A = 0;
element.addClass(TOOLBAR + " k-widget");
this.uid = kendo.guid();
+ this._isRtl = kendo.support.isRtl(element);
+ this._groups = {};
element.attr(KENDO_UID_ATTR, this.uid);
that.isMobile = (typeof options.mobile === "boolean") ? options.mobile : that.element.closest(".km-root")[0];
@@ -20008,7 +21049,7 @@ var A = 0;
tap: proxy(that._toggleOverflow, that)
});
- kendo.onResize(function() {
+ that._resizeHandler = kendo.onResize(function() {
that.resize();
});
} else {
@@ -20032,9 +21073,11 @@ var A = 0;
release: toggleActive
});
- that.element.on(CLICK, "." + STATE_DISABLED, preventClick);
+ that.element.on(CLICK, "a.k-button", preventClick);
+ that._navigatable();
+
if (options.resizable) {
- that.popup.element.on(CLICK, + "." + STATE_DISABLED, preventClick);
+ that.popup.element.on(CLICK, + "a.k-button", preventClick);
}
if (options.resizable) {
@@ -20060,6 +21103,19 @@ var A = 0;
mobile: null
},
+ addToGroup: function(button, groupName) {
+ var group;
+
+ if (!this._groups[groupName]) {
+ group = this._groups[groupName] = new Group();
+ } else {
+ group = this._groups[groupName];
+ }
+
+ group.add(button);
+ return group;
+ },
+
destroy: function() {
var that = this;
@@ -20067,10 +21123,14 @@ var A = 0;
$(element).data("kendoPopup").destroy();
});
+ that.element.off(CLICK, "a.k-button");
+
that.userEvents.destroy();
if (that.options.resizable) {
+ kendo.unbindResize(that._resizeHandler);
that.overflowUserEvents.destroy();
+ that.popup.element.off(CLICK, "a.k-button");
that.popup.destroy();
}
@@ -20080,10 +21140,10 @@ var A = 0;
add: function(options) {
var component = components[options.type],
template = options.template,
- element, that = this,
+ tool, that = this,
itemClasses = that.isMobile ? "" : "k-item k-state-default",
overflowTemplate = options.overflowTemplate,
- overflowElement;
+ overflowTool;
$.extend(options, {
uid: kendo.guid(),
@@ -20094,35 +21154,27 @@ var A = 0;
if (template && !overflowTemplate) {
options.overflow = OVERFLOW_NEVER;
+ } else if (!options.overflow) {
+ options.overflow = OVERFLOW_AUTO;
}
//add the command in the overflow popup
if (options.overflow !== OVERFLOW_NEVER && that.options.resizable) {
if (overflowTemplate) { //template command
- overflowElement = isFunction(overflowTemplate) ? $(overflowTemplate(options)) : $(overflowTemplate);
-
- if (options.id) {
- overflowElement.attr("id", options.id + "_overflow");
- }
+ overflowTool = new OverflowTemplateItem(overflowTemplate, options, that);
} else if (component) { //build-in command
- overflowElement = (component.overflow || $.noop)(options);
+ overflowTool = new component.overflow(options, that);
+ overflowTool.element.addClass(itemClasses);
}
- if (overflowElement && overflowElement.length) {
- if(overflowElement.prop("tagName") !== "LI") {
- overflowElement.removeAttr(KENDO_UID_ATTR);
- overflowElement = overflowElement.wrap("").parent();
- overflowElement.attr(KENDO_UID_ATTR, options.uid);
- }
- that._attributes(overflowElement, options);
- overflowElement.addClass(itemClasses).appendTo(that.popup.container);
-
- if (overflowElement.data("overflow") === OVERFLOW_AUTO) {
- overflowElement.addClass(OVERFLOW_HIDDEN);
+ if (overflowTool) {
+ if (options.overflow === OVERFLOW_AUTO) {
+ overflowTool.overflowHidden();
}
+ overflowTool.element.appendTo(that.popup.container);
that.angular("compile", function(){
- return { elements: overflowElement.get() };
+ return { elements: overflowTool.element.get() };
});
}
}
@@ -20130,100 +21182,129 @@ var A = 0;
//add the command in the toolbar container
if (options.overflow !== OVERFLOW_ALWAYS) {
if (template) { //template command
- element = isFunction(template) ? template(options) : template;
-
- if (!(element instanceof jQuery)) {
- element = $(element.replace(/^\s+|\s+$/g, ''));
- }
-
- element = element.wrap("").parent();
- if (options.id) {
- element.attr("id", options.id);
- }
- if (options.attributes) {
- element.attr(options.attributes);
- }
- element.attr(KENDO_UID_ATTR, options.uid);
+ tool = new TemplateItem(template, options, that);
} else if (component) { //build-in command
- element = (component.toolbar || $.noop)(options);
+ tool = new component.toolbar(options, that);
}
- if (element && element.length) {
- that._attributes(element, options);
-
+ if (tool) {
if (that.options.resizable) {
- element.appendTo(that.element).css("visibility", "hidden");
+ tool.element.appendTo(that.element).css("visibility", "hidden");
that._shrink(that.element.innerWidth());
- element.css("visibility", "visible");
+ tool.element.css("visibility", "visible");
} else {
- element.appendTo(that.element);
+ tool.element.appendTo(that.element);
}
that.angular("compile", function(){
- return { elements: element.get() };
+ return { elements: tool.element.get() };
});
}
}
},
- remove: function(element) {
- var toolbarElement,
- overflowElement,
+ _getItem: function(candidate) {
+ var element,
+ toolbarItem,
+ overflowItem,
isResizable = this.options.resizable,
- type, uid;
+ type;
+
+ element = this.element.find(candidate);
+ type = element.length ? element.data("type") : "";
+ toolbarItem = element.data(type);
+
+ if (toolbarItem && toolbarItem.main) {
+ element = element.parent("." + SPLIT_BUTTON);
+ type = "splitButton";
+ toolbarItem = element.data(type);
+ }
- toolbarElement = this.element.find(element);
+ if (!element.length && isResizable) {
+ element = this.popup.element.find(candidate);
+ type = element.data("type");
+ overflowItem = element.data(type);
+ }
+
+ if (overflowItem && overflowItem.main) {
+ element = element.parent("." + SPLIT_BUTTON);
+ type = "splitButton";
+ overflowItem = element.data(type);
+ }
- if (isResizable) {
- overflowElement = this.popup.element.find(element);
+ if (toolbarItem && isResizable) {
+ overflowItem = toolbarItem.twin();
}
- if (toolbarElement.length) {
- type = toolbarElement.data("type");
- uid = toolbarElement.attr(KENDO_UID_ATTR);
+ return {
+ type: type,
+ toolbar: toolbarItem,
+ overflow: overflowItem
+ };
+ },
+
+ remove: function(candidate) {
+ var item = this._getItem(candidate);
+
+ if (item.toolbar) { item.toolbar.remove(); }
+ if (item.overflow) { item.overflow.remove(); }
+
+ this.resize(true);
+ },
+
+ hide: function(candidate) {
+ var item = this._getItem(candidate);
- if (toolbarElement.parent("." + SPLIT_BUTTON).data("type") === "splitButton") {
- type = "splitButton";
- toolbarElement = toolbarElement.parent();
+ if (item.toolbar) {
+ item.toolbar.hide();
+
+ if (item.toolbar.options.type === "button" && item.toolbar.options.isChild) {
+ item.toolbar.getParentGroup().refresh();
}
+ }
- overflowElement = isResizable ? this.popup.element.find("li[" + KENDO_UID_ATTR + "='" + uid + "']") : $([]);
- } else if (overflowElement.length) {
- type = overflowElement.data("type");
- overflowElement = overflowElement.parent();
+ if (item.overflow) {
+ item.overflow.hide();
- if (overflowElement.data("type") === "splitButton") {
- type = "splitButton";
+ if (item.overflow.options.type === "button" && item.overflow.options.isChild) {
+ item.overflow.getParentGroup().refresh();
}
+ }
+
+ this.resize(true);
+ },
- uid = overflowElement.attr(KENDO_UID_ATTR);
- toolbarElement = this.element.find("div." + SPLIT_BUTTON + "[" + KENDO_UID_ATTR + "='" + uid + "']");
+ show: function(candidate) {
+ var item = this._getItem(candidate);
+
+ if (item.toolbar) {
+ item.toolbar.show();
+
+ if (item.toolbar.options.type === "button" && item.toolbar.options.isChild) {
+ item.toolbar.getParentGroup().refresh();
+ }
}
- if (type === "splitButton" && toolbarElement.data("kendoPopup")) {
- toolbarElement.data("kendoPopup").destroy();
+ if (item.overflow) {
+ item.overflow.show();
+
+ if (item.overflow.options.type === "button" && item.overflow.options.isChild) {
+ item.overflow.getParentGroup().refresh();
+ }
}
- toolbarElement.remove();
- overflowElement.remove();
+ this.resize(true);
},
enable: function(element, enable) {
- var uid = this.element.find(element).attr(KENDO_UID_ATTR);
-
- if (!uid && this.popup) {
- uid = this.popup.element.find(element).parent("li").attr(KENDO_UID_ATTR);
- }
+ var item = this._getItem(element);
if (typeof enable == "undefined") {
enable = true;
}
- if (enable) {
- $("[" + KENDO_UID_ATTR + "='" + uid + "']").removeClass(STATE_DISABLED);
- } else {
- $("[" + KENDO_UID_ATTR + "='" + uid + "']").addClass(STATE_DISABLED);
- }
+ if (item.toolbar) { item.toolbar.enable(enable); }
+ if (item.overflow) { item.overflow.enable(enable); }
},
getSelectedFromGroup: function(groupName) {
@@ -20232,41 +21313,21 @@ var A = 0;
toggle: function(button, checked) {
var element = $(button),
- uid = element.data("uid"),
- group = element.data("group"),
- twinElement;
-
- if (element.hasClass(TOGGLE_BUTTON)) {
+ item = element.data("button");
- if (group) { //find all buttons from the same group
- this.element
- .add(this.popup.element)
- .find("." + TOGGLE_BUTTON + "[data-group='" + group + "']")
- .filter("." + STATE_ACTIVE)
- .removeClass(STATE_ACTIVE);
+ if (item.options.togglable) {
+ if (checked === undefined) {
+ checked = true;
}
-
- if ($.contains(this.element[0], element[0])) {
- twinElement = this.popup.element.find("[" + KENDO_UID_ATTR + "='" + uid + "']");
- if (twinElement.prop("tagName") === "LI") {
- twinElement = twinElement.find("." + TOGGLE_BUTTON + ":first");
- }
- } else {
- uid = uid ? uid : element.parent().data("uid");
- twinElement = this.element.find("[" + KENDO_UID_ATTR + "='" + uid + "']");
- }
-
- element.add(twinElement).toggleClass(STATE_ACTIVE, checked);
+ item.toggle(checked, true);
}
},
- _attributes: function(element, options) {
- element.attr(kendo.attr("overflow"), options.overflow || OVERFLOW_AUTO);
- },
-
_renderOverflow: function() {
var that = this,
- overflowContainer = components.overflowContainer;
+ overflowContainer = components.overflowContainer,
+ isRtl = that._isRtl,
+ horizontalDirection = isRtl ? "left" : "right";
that.overflowAnchor = $(components.overflowAnchor).addClass(BUTTON);
@@ -20276,13 +21337,14 @@ var A = 0;
that.overflowAnchor.append('');
overflowContainer = actionSheetWrap(overflowContainer);
} else {
- that.overflowAnchor.append('');
+ that.overflowAnchor.append('');
}
that.popup = new kendo.ui.Popup(overflowContainer, {
- origin: "bottom right",
- position: "top right",
+ origin: "bottom " + horizontalDirection,
+ position: "top " + horizontalDirection,
anchor: that.overflowAnchor,
+ isRtl: isRtl,
animation: that.animation,
appendTo: that.isMobile ? $(that.isMobile).children(".km-pane") : null,
copyAnchorStyles: false,
@@ -20291,7 +21353,7 @@ var A = 0;
.addClass("k-overflow-wrapper");
if (!that.isMobile) {
- wrapper.css("margin-left", (wrapper.outerWidth() - wrapper.width()) / 2 + 1);
+ wrapper.css("margin-left", (isRtl ? -1 : 1) * ((wrapper.outerWidth() - wrapper.width()) / 2 + 1));
} else {
that.popup.container.css("max-height", (parseFloat($(".km-content:visible").innerHeight()) - 15) + "px");
}
@@ -20300,10 +21362,37 @@ var A = 0;
e.preventDefault();
}
},
+ activate: function() {
+ this.element.find(":kendoFocusable").first().focus();
+ },
close: function (e) {
if (that.trigger(OVERFLOW_CLOSE)) {
e.preventDefault();
}
+
+ this.element.focus();
+ }
+ });
+
+ that.popup.element.on("keydown", "." + BUTTON, function(e) {
+ var target = $(e.target),
+ li = target.parent(),
+ isComplexTool = li.is("." + BUTTON_GROUP) || li.is("." + SPLIT_BUTTON),
+ element;
+
+ e.preventDefault();
+
+ if (e.keyCode === keys.ESC || e.keyCode === keys.TAB || (e.altKey && e.keyCode === keys.UP)) {
+ that._toggleOverflow();
+ that.overflowAnchor.focus();
+ } else if (e.keyCode === keys.DOWN) {
+ element = !isComplexTool || (isComplexTool && target.is(":last-child")) ? li : target;
+ findFocusableSibling(element, "next").focus();
+ } else if (e.keyCode === keys.UP) {
+ element = !isComplexTool || (isComplexTool && target.is(":first-child")) ? li : target;
+ findFocusableSibling(element, "prev").focus();
+ } else if (e.keyCode === keys.SPACEBAR || e.keyCode === keys.ENTER) {
+ that.userEvents.trigger("tap", { target: $(e.target) });
}
});
@@ -20332,48 +21421,45 @@ var A = 0;
_buttonClick: function(e) {
var that = this, popup,
- target, splitContainer,
- isDisabled, isChecked,
- group, handler, eventData, id;
+ target, item, splitContainer,
+ isSplitButtonArrow = e.target.closest("." + SPLIT_BUTTON_ARROW).length,
+ handler, eventData;
e.preventDefault();
+ if (isSplitButtonArrow) {
+ that._toggle(e);
+ return;
+ }
+
target = $(e.target).closest("." + BUTTON, that.element);
if (target.hasClass(OVERFLOW_ANCHOR)) {
return;
}
- if (!target.length && that.popup) {
- target = $(e.target).closest("." + OVERFLOW_BUTTON, that.popup.container);
- }
+ item = target.data("button");
- isDisabled = target.hasClass(OVERFLOW_BUTTON) ? target.parent("li").hasClass(STATE_DISABLED) : target.hasClass(STATE_DISABLED);
-
- if (isDisabled) {
- return;
+ if (!item && that.popup) {
+ target = $(e.target).closest("." + OVERFLOW_BUTTON, that.popup.container);
+ item = target.parent("li").data("button");
}
- if (e.target.closest("." + SPLIT_BUTTON_ARROW).length) {
- that._toggle(e);
+ if (!item || !item.options.enable) {
return;
}
- id = target.attr("id") ? target.attr("id").replace(/(_overflow$)/, "") : undefined;
+ if (item.options.togglable) {
+ handler = isFunction(item.toggleHandler) ? item.toggleHandler : null;
- if (target.hasClass(TOGGLE_BUTTON)) {
- group = target.data("group");
- handler = isFunction(target.data("toggle")) ? target.data("toggle") : null;
-
- that.toggle(target);
- isChecked = target.hasClass(STATE_ACTIVE);
- eventData = { target: target, group: group, checked: isChecked, id: id };
+ item.toggle(!item.options.selected, true);
+ eventData = { target: target, group: item.options.group, checked: item.options.selected, id: item.options.id };
if (handler) { handler.call(that, eventData); }
that.trigger(TOGGLE, eventData);
} else {
- handler = isFunction(target.data("click")) ? target.data("click") : null;
- eventData = { target: target, id: id };
+ handler = isFunction(item.clickHandler) ? item.clickHandler : null;
+ eventData = { sender: that, target: target, id: item.options.id };
if (handler) { handler.call(that, eventData); }
that.trigger(CLICK, eventData);
@@ -20390,25 +21476,103 @@ var A = 0;
}
},
+ _navigatable: function() {
+ var that = this;
+
+ that.element
+ .attr("tabindex", 0)
+ .focus(function() {
+ var element = $(this).find(":kendoFocusable:first");
+
+ if (element.is("." + OVERFLOW_ANCHOR)) {
+ element = findFocusableSibling(element, "next");
+ }
+
+ element[0].focus();
+ })
+ .on("keydown", proxy(that._keydown, that));
+ },
+
+ _keydown: function(e) {
+ var target = $(e.target),
+ keyCode = e.keyCode,
+ items = this.element.children(":not(.k-separator):visible");
+
+ if (keyCode === keys.TAB) {
+ var element = target.parentsUntil(this.element).last(),
+ lastHasFocus = false;
+
+ if (!element.length) {
+ element = target;
+ }
+
+ if (element.is("." + OVERFLOW_ANCHOR)) {
+ if (e.shiftKey) {
+ e.preventDefault();
+ }
+
+ if (items.last().is(":kendoFocusable")) {
+ items.last().focus();
+ } else {
+ items.last().find(":kendoFocusable").last().focus();
+ }
+ }
+
+ if (!e.shiftKey && items.index(element) === items.length - 1) {
+ if (element.is("." + BUTTON_GROUP)) {
+ lastHasFocus = target.is(":last-child");
+ } else {
+ lastHasFocus = true;
+ }
+ }
+
+ if (lastHasFocus) {
+ e.preventDefault();
+ this.overflowAnchor.focus();
+ }
+ }
+
+ if (e.altKey && keyCode === keys.DOWN) {
+ var splitButton = $(document.activeElement).data("splitButton");
+ var isOverflowAnchor = $(document.activeElement).is("." + OVERFLOW_ANCHOR);
+
+ if (splitButton) {
+ splitButton.toggle();
+ } else if (isOverflowAnchor) {
+ this._toggleOverflow();
+ }
+
+ return;
+ }
+
+ if (keyCode === keys.SPACEBAR || keyCode === keys.ENTER) {
+ if (target.is("." + SPLIT_BUTTON)) {
+ target = target.children().first();
+ }
+ this.userEvents.trigger("tap", { target: target });
+
+ return;
+ }
+ },
+
_toggle: function(e) {
- var splitButton = $(e.target).closest("." + SPLIT_BUTTON),
- popup = splitButton.data("kendoPopup"),
+ var splitButton = $(e.target).closest("." + SPLIT_BUTTON).data("splitButton"),
isDefaultPrevented;
e.preventDefault();
- if (splitButton.hasClass(STATE_DISABLED)) {
+ if (!splitButton.options.enable) {
return;
}
- if (popup.element.is(":visible")) {
- isDefaultPrevented = this.trigger(CLOSE, { target: splitButton });
+ if (splitButton.popup.element.is(":visible")) {
+ isDefaultPrevented = this.trigger(CLOSE, { target: splitButton.element });
} else {
- isDefaultPrevented = this.trigger(OPEN, { target: splitButton });
+ isDefaultPrevented = this.trigger(OPEN, { target: splitButton.element });
}
if (!isDefaultPrevented) {
- popup.toggle();
+ splitButton.toggle();
}
},
@@ -20436,7 +21600,7 @@ var A = 0;
_childrenWidth: function() {
var childrenWidth = 0;
- this.element.children(":visible").each(function() {
+ this.element.children(":visible:not('." + STATE_HIDDEN + "')").each(function() {
childrenWidth += $(this).outerWidth(true);
});
@@ -20466,7 +21630,7 @@ var A = 0;
hiddenCommands;
if (containerWidth > this._childrenWidth()) {
- hiddenCommands = this.element.children(":hidden");
+ hiddenCommands = this.element.children(":hidden:not('." + STATE_HIDDEN + "')");
for (var i = 0; i < hiddenCommands.length ; i++) {
commandElement = hiddenCommands.eq(i);
@@ -20521,6 +21685,7 @@ var A = 0;
+/*jshint evil: true*/
(function($, undefined) {
var kendo = window.kendo,
ui = kendo.ui,
@@ -20531,9 +21696,7 @@ var A = 0;
activeElement = kendo._activeElement,
ObservableArray = kendo.data.ObservableArray,
ID = "id",
- LI = "li",
CHANGE = "change",
- CHARACTER = "character",
FOCUSED = "k-state-focused",
HOVER = "k-state-hover",
LOADING = "k-loading",
@@ -20541,7 +21704,7 @@ var A = 0;
CLOSE = "close",
SELECT = "select",
SELECTED = "selected",
- PROGRESS = "progress",
+ REQUESTSTART = "requestStart",
REQUESTEND = "requestEnd",
WIDTH = "width",
extend = $.extend,
@@ -20627,6 +21790,81 @@ var A = 0;
});
},
+ _listOptions: function(options) {
+ var currentOptions = this.options;
+
+ options = options || {};
+ options = {
+ height: options.height || currentOptions.height,
+ dataValueField: options.dataValueField || currentOptions.dataValueField,
+ dataTextField: options.dataTextField || currentOptions.dataTextField,
+ groupTemplate: options.groupTemplate || currentOptions.groupTemplate,
+ fixedGroupTemplate: options.fixedGroupTemplate || currentOptions.fixedGroupTemplate,
+ template: options.template || currentOptions.template
+ };
+
+ if (!options.template) {
+ options.template = "#:" + kendo.expr(options.dataTextField, "data") + "#";
+ }
+
+ return options;
+ },
+
+ _initList: function() {
+ var that = this;
+ var options = that.options;
+ var virtual = options.virtual;
+ var hasVirtual = !!virtual;
+ var value = options.value;
+
+ var listBoundHandler = proxy(that._listBound, that);
+
+ var listOptions = {
+ autoBind: false,
+ selectable: true,
+ dataSource: that.dataSource,
+ click: proxy(that._click, that),
+ change: proxy(that._listChange, that),
+ activate: proxy(that._activateItem, that),
+ deactivate: proxy(that._deactivateItem, that),
+ dataBinding: function() {
+ that.trigger("dataBinding");
+ that._angularItems("cleanup");
+ },
+ dataBound: listBoundHandler,
+ listBound: listBoundHandler,
+ selectedItemChange: proxy(that._listChange, that)
+ };
+
+ listOptions = $.extend(that._listOptions(), listOptions, typeof virtual === "object" ? virtual : {});
+
+ if (!hasVirtual) {
+ that.listView = new kendo.ui.StaticList(that.ul, listOptions);
+ } else {
+ that.listView = new kendo.ui.VirtualList(that.ul, listOptions);
+ }
+
+ if (value !== undefined) {
+ that.listView.value(value).done(function() {
+ var text = options.text;
+
+ if (!that.listView.filter() && that.input) {
+ if (that.selectedIndex === -1) {
+ if (text === undefined || text === null) {
+ text = value;
+ }
+
+ that._accessor(value);
+ that.input.val(text);
+ that._placeholder();
+ } else if (that._oldIndex === -1) {
+ that._oldIndex = that.selectedIndex;
+ }
+ }
+ });
+ }
+ },
+
_listMousedown: function(e) {
if (!this.filterInput || this.filterInput[0] !== e.target) {
e.preventDefault();
@@ -20646,14 +21884,18 @@ var A = 0;
}
if (filter) {
- expression = expression.filters || [];
- expression.push(filter);
+ expression = {
+ filters: expression.filters || [],
+ logic: "and"
+ };
+
+ expression.filters.push(filter);
}
if (!force) {
dataSource.filter(expression);
} else {
- dataSource.read(expression);
+ dataSource.read({ filter: expression });
}
},
@@ -20731,10 +21973,6 @@ var A = 0;
that.listView.destroy();
that.list.off(ns);
- if (that._touchScroller) {
- that._touchScroller.destroy();
- }
-
that.popup.destroy();
if (that._form) {
@@ -20753,7 +21991,18 @@ var A = 0;
index = $(that.items()).index(index);
}
- return that.listView.data()[index];
+ return that.dataSource.flatView()[index];
+ },
+
+ _activateItem: function() {
+ var current = this.listView.focus();
+ if (current) {
+ this._focused.add(this.filterInput).attr("aria-activedescendant", current.attr("id"));
+ }
+ },
+
+ _deactivateItem: function() {
+ this._focused.add(this.filterInput).removeAttr("aria-activedescendant");
},
_accessors: function() {
@@ -20820,11 +22069,15 @@ var A = 0;
that._old = value;
that._oldIndex = index;
- // trigger the DOM change event so any subscriber gets notified
- that.element.trigger(CHANGE);
+ if (!that._typing) {
+ // trigger the DOM change event so any subscriber gets notified
+ that.element.trigger(CHANGE);
+ }
that.trigger(CHANGE);
}
+
+ that.typing = false;
},
_data: function() {
@@ -20857,6 +22110,23 @@ var A = 0;
return value;
},
+ _offsetHeight: function() {
+ var offsetHeight = 0;
+ var siblings = this.listView.content.prevAll(":visible");
+
+ siblings.each(function() {
+ var element = $(this);
+
+ if (element.hasClass("k-list-filter")) {
+ offsetHeight += element.children().outerHeight();
+ } else {
+ offsetHeight += element.outerHeight();
+ }
+ });
+
+ return offsetHeight;
+ },
+
_height: function(length) {
var that = this;
var list = that.list;
@@ -20868,19 +22138,19 @@ var A = 0;
if (length) {
popups = list.add(list.parent(".k-animation-container")).show();
- height = that.ul[0].scrollHeight > height ? height : "auto";
+ height = that.listView.content[0].scrollHeight > height ? height : "auto";
popups.height(height);
if (height !== "auto") {
- offsetTop = that.ul[0].offsetTop;
+ offsetTop = that._offsetHeight();
if (offsetTop) {
- height = list.height() - offsetTop;
+ height -= offsetTop;
}
}
- that.ul.height(height);
+ that.listView.content.height(height);
if (!visible) {
popups.hide();
@@ -20961,9 +22231,8 @@ var A = 0;
},
_calculateGroupPadding: function(height) {
- var ul = this.ul;
- var li = $(ul[0].firstChild);
- var groupHeader = ul.prev(".k-static-header");
+ var li = this.ul.children(".k-first:first");
+ var groupHeader = this.listView.content.prev(".k-group-header");
var padding = 0;
if (groupHeader[0] && groupHeader[0].style.display !== "none") {
@@ -20971,15 +22240,14 @@ var A = 0;
padding = kendo.support.scrollbar();
}
- padding += parseFloat(li.css("border-right-width"), 10) + parseFloat(li.children(".k-group").css("right"), 10);
+ padding += parseFloat(li.css("border-right-width"), 10) + parseFloat(li.children(".k-group").css("padding-right"), 10);
groupHeader.css("padding-right", padding);
}
},
- //use length of the items in ListView
_firstOpen: function() {
- var height = this._height(this.listView.data().length);
+ var height = this._height(this.dataSource.flatView().length);
this._calculateGroupPadding(height);
},
@@ -20997,8 +22265,6 @@ var A = 0;
if (!that.options.virtual) {
that.popup.one(OPEN, proxy(that._firstOpen, that));
}
-
- that._touchScroller = kendo.touchScroller(that.popup.element);
},
_makeUnselectable: function() {
@@ -21018,7 +22284,9 @@ var A = 0;
open = open !== undefined? open : !that.popup.visible();
if (!preventFocus && !touchEnabled && that._focused[0] !== activeElement()) {
+ that._prevent = true;
that._focused.focus();
+ that._prevent = false;
}
that[open ? OPEN : CLOSE]();
@@ -21027,8 +22295,8 @@ var A = 0;
_triggerCascade: function() {
var that = this;
- if (!that._bound || that._old !== that.value()) {
- that._bound = true;
+ if (!that._cascadeTriggered || that._old !== that.value() || that._oldIndex !== that.selectedIndex) {
+ that._cascadeTriggered = true;
that.trigger("cascade", { userTriggered: that._userTriggered });
}
},
@@ -21036,7 +22304,7 @@ var A = 0;
_unbindDataSource: function() {
var that = this;
- that.dataSource.unbind(PROGRESS, that._progressHandler)
+ that.dataSource.unbind(REQUESTSTART, that._requestStartHandler)
.unbind(REQUESTEND, that._requestEndHandler)
.unbind("error", that._errorHandler);
}
@@ -21069,15 +22337,23 @@ var A = 0;
},
setDataSource: function(dataSource) {
- this.options.dataSource = dataSource;
+ var that = this;
+ var parent;
- this._dataSource();
- this._bound = false;
+ that.options.dataSource = dataSource;
- this.listView.setDataSource(this.dataSource);
+ that._dataSource();
- if (this.options.autoBind) {
- this.dataSource.fetch();
+ that.listView.setDataSource(that.dataSource);
+
+ if (that.options.autoBind) {
+ that.dataSource.fetch();
+ }
+
+ parent = that._parentWidget();
+
+ if (parent) {
+ that._cascadeSelect(parent);
}
},
@@ -21107,7 +22383,7 @@ var A = 0;
var filter = options.filter;
var field = options.dataTextField;
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
if (!length || length >= options.minLength) {
that._state = "filter";
@@ -21136,6 +22412,9 @@ var A = 0;
if (value === undefined) {
return element.value;
} else {
+ if (value === null) {
+ value = "";
+ }
element.value = value;
}
},
@@ -21146,7 +22425,9 @@ var A = 0;
var option;
if (value === undefined) {
- option = element.options[selectedIndex];
+ if (selectedIndex > -1) {
+ option = element.options[selectedIndex];
+ }
if (option) {
value = option.value;
@@ -21161,14 +22442,22 @@ var A = 0;
idx = -1;
}
- if (idx == -1 && value !== "") {
- idx = this._custom(value);
- }
+ if (value !== null && value !== "" && idx == -1) {
+ this._custom(value);
+ } else {
+ if (value) {
+ element.value = value;
+ } else {
+ element.selectedIndex = idx;
+ }
- element.selectedIndex = idx;
- option = element.options[idx];
- if (option) {
- option.setAttribute(SELECTED, SELECTED);
+ if (element.selectedIndex > -1) {
+ option = element.options[element.selectedIndex];
+ }
+
+ if (option) {
+ option.setAttribute(SELECTED, SELECTED);
+ }
}
}
},
@@ -21177,20 +22466,17 @@ var A = 0;
var that = this;
var element = that.element;
var custom = that._customOption;
- var idx = element[0].children.length - 1;
if (!custom) {
custom = $("");
that._customOption = custom;
element.append(custom);
- idx += 1;
}
custom.text(value);
+ custom[0].setAttribute(SELECTED, SELECTED);
custom[0].selected = true;
-
- return idx;
},
_hideBusy: function () {
@@ -21220,6 +22506,7 @@ var A = 0;
_requestEnd: function() {
this._request = false;
+ this._hideBusy();
},
_dataSource: function() {
@@ -21245,37 +22532,36 @@ var A = 0;
if (that.dataSource) {
that._unbindDataSource();
} else {
- that._progressHandler = proxy(that._showBusy, that);
+ that._requestStartHandler = proxy(that._showBusy, that);
that._requestEndHandler = proxy(that._requestEnd, that);
that._errorHandler = proxy(that._hideBusy, that);
}
that.dataSource = kendo.data.DataSource.create(dataSource)
- .bind(PROGRESS, that._progressHandler)
+ .bind(REQUESTSTART, that._requestStartHandler)
.bind(REQUESTEND, that._requestEndHandler)
.bind("error", that._errorHandler);
},
_firstItem: function() {
- this.listView.first();
+ this.listView.focusFirst();
},
_lastItem: function() {
- this.listView.last();
+ this.listView.focusLast();
},
_nextItem: function() {
- this.listView.next();
+ this.listView.focusNext();
},
_prevItem: function() {
- this.listView.prev();
+ this.listView.focusPrev();
},
_move: function(e) {
var that = this;
var key = e.keyCode;
- var ul = that.ul[0];
var down = key === keys.DOWN;
var dataItem;
var pressed;
@@ -21288,8 +22574,8 @@ var A = 0;
if (!that.listView.isBound()) {
if (!that._fetch) {
that.dataSource.one(CHANGE, function() {
- that._move(e);
that._fetch = false;
+ that._move(e);
});
that._fetch = true;
@@ -21303,7 +22589,7 @@ var A = 0;
current = that._focus();
- if (!that._fetch) {
+ if (!that._fetch && (!current || current.hasClass("k-state-selected"))) {
if (down) {
that._nextItem();
@@ -21320,12 +22606,11 @@ var A = 0;
}
if (that.trigger(SELECT, { item: that.listView.focus() })) {
- that._focus(current); //revert focus
+ that._focus(current);
return;
}
that._select(that._focus(), true);
- //that.listView.select(that.listView.focus());
if (!that.popup.visible()) {
that._blur();
@@ -21354,7 +22639,7 @@ var A = 0;
}
that._select(current);
- } else {
+ } else if (that.input) {
that._accessor(that.input.val());
that.listView.value(that.input.val());
}
@@ -21386,8 +22671,7 @@ var A = 0;
var that = this;
var hasItems = !!that.dataSource.view().length;
- //if request is started avoid datasource.fetch
- if (that.element[0].disabled || that._request || that.options.cascadeFrom) {
+ if (that._request || that.options.cascadeFrom) {
return;
}
@@ -21399,7 +22683,7 @@ var A = 0;
}
},
- _options: function(data, optionLabel) {
+ _options: function(data, optionLabel, value) {
var that = this,
element = that.element,
length = data.length,
@@ -21441,6 +22725,13 @@ var A = 0;
}
element.html(options);
+
+ if (value !== undefined) {
+ element[0].value = value;
+ if (element[0].value && !value) {
+ element[0].selectedIndex = -1;
+ }
+ }
},
_reset: function() {
@@ -21460,93 +22751,108 @@ var A = 0;
}
},
+ _parentWidget: function() {
+ var name = this.options.name;
+ var parentElement = $("#" + this.options.cascadeFrom);
+ var parent = parentElement.data("kendo" + name);
+
+ if (!parent) {
+ parent = parentElement.data("kendo" + alternativeNames[name]);
+ }
+
+ return parent;
+ },
+
_cascade: function() {
var that = this,
options = that.options,
cascade = options.cascadeFrom,
- parent, parentElement,
- select, valueField,
- change;
+ parent;
if (cascade) {
- parentElement = $("#" + cascade);
- parent = parentElement.data("kendo" + options.name);
-
- if (!parent) {
- parent = parentElement.data("kendo" + alternativeNames[options.name]);
- }
+ parent = that._parentWidget();
if (!parent) {
return;
}
options.autoBind = false;
- valueField = options.cascadeFromField || parent.options.dataValueField;
- change = function() {
- that.dataSource.unbind(CHANGE, change);
+ parent.first("cascade", function(e) {
+ that._userTriggered = e.userTriggered;
- var value = that.listView.value()[0];
- if (that._userTriggered) {
+ if (that.listView.isBound()) {
that._clearSelection(parent, true);
- } else if (value) {
- that.value(value);
- if (!that.dataSource.view()[0] || that.selectedIndex === -1) {
- that._clearSelection(parent, true);
- }
- } else if (that.listView.data().length) {
- that.select(options.index);
- }
-
- that.enable();
- that._triggerCascade();
- that._userTriggered = false;
- };
- select = function() {
- var dataItem = parent.dataItem(),
- filterValue = dataItem ? parent._value(dataItem) : null,
- expressions, filters;
-
- if (filterValue || filterValue === 0) {
- expressions = that.dataSource.filter() || {};
- removeFiltersForField(expressions, valueField);
- filters = expressions.filters || [];
-
- filters.push({
- field: valueField,
- operator: "eq",
- value: filterValue
- });
-
- var handler = function() {
- that.unbind("dataBound", handler);
- change.apply(that, arguments);
- };
-
- that.first("dataBound", handler);
-
- that.dataSource.filter(filters);
-
- } else {
- that.enable(false);
- that._clearSelection(parent);
- that._triggerCascade();
- that._userTriggered = false;
}
- };
- parent.first("cascade", function(e) {
- that._userTriggered = e.userTriggered;
- select();
+ that._cascadeSelect(parent);
});
//refresh was called
if (parent.listView.isBound()) {
- select();
+ that._cascadeSelect(parent);
} else if (!parent.value()) {
that.enable(false);
}
}
+ },
+
+ _cascadeChange: function(parent) {
+ var that = this;
+ var value = that._accessor();
+
+ if (that._userTriggered) {
+ that._clearSelection(parent, true);
+ } else if (value) {
+ if (value !== that.listView.value()[0]) {
+ that.value(value);
+ }
+
+ if (!that.dataSource.view()[0] || that.selectedIndex === -1) {
+ that._clearSelection(parent, true);
+ }
+ } else if (that.dataSource.flatView().length) {
+ that.select(that.options.index);
+ }
+
+ that.enable();
+ that._triggerCascade();
+ that._userTriggered = false;
+ },
+
+ _cascadeSelect: function(parent) {
+ var that = this;
+ var dataItem = parent.dataItem();
+ var filterValue = dataItem ? parent._value(dataItem) : null;
+ var valueField = that.options.cascadeFromField || parent.options.dataValueField;
+ var expressions, filters;
+
+ if (filterValue || filterValue === 0) {
+ expressions = that.dataSource.filter() || {};
+ removeFiltersForField(expressions, valueField);
+ filters = expressions.filters || [];
+
+ filters.push({
+ field: valueField,
+ operator: "eq",
+ value: filterValue
+ });
+
+ var handler = function() {
+ that.unbind("dataBound", handler);
+ that._cascadeChange(parent);
+ };
+
+ that.first("dataBound", handler);
+
+ that.dataSource.filter(filters);
+
+ } else {
+ that.enable(false);
+ that._clearSelection(parent);
+ that._triggerCascade();
+ that._userTriggered = false;
+ }
}
});
@@ -21557,15 +22863,18 @@ var A = 0;
Widget.fn.init.call(this, element, options);
this.element.attr("role", "listbox")
- .css({ overflow: support.kineticScrollNeeded ? "": "auto" })
.on("click" + STATIC_LIST_NS, "li", proxy(this._click, this))
.on("mouseenter" + STATIC_LIST_NS, "li", function() { $(this).addClass(HOVER); })
.on("mouseleave" + STATIC_LIST_NS, "li", function() { $(this).removeClass(HOVER); });
-
- this.header = this.element.before('').prev();
-
- this.setDataSource(this.options.dataSource);
+ this.content = this.element
+ .wrap("")
+ .parent()
+ .css({
+ "overflow": "auto",
+ "position": "relative"
+ });
+ this.header = this.content.before('').prev();
this._bound = false;
@@ -21577,9 +22886,17 @@ var A = 0;
this._dataItems = [];
this._values = [];
+ var value = this.options.value;
+
+ if (value) {
+ this._values = $.isArray(value) ? value.slice(0) : [value];
+ }
+
this._getter();
this._templates();
+ this.setDataSource(this.options.dataSource);
+
this._onScroll = proxy(function() {
var that = this;
clearTimeout(that._scrollId);
@@ -21588,18 +22905,12 @@ var A = 0;
that._renderHeader();
}, 50);
}, this);
-
- this._fixedHeader();
-
- var value = this.options.value;
- if (value) {
- this._values = $.isArray(value) ? value.slice(0) : [value];
- }
},
options: {
name: "StaticList",
dataValueField: null,
+ valuePrimitive: false,
selectable: true,
template: null,
groupTemplate: null,
@@ -21612,36 +22923,41 @@ var A = 0;
"activate",
"deactivate",
"dataBinding",
- "dataBound"
+ "dataBound",
+ "selectedItemChange"
],
setDataSource: function(source) {
var that = this;
var dataSource = source || {};
+ var value;
dataSource = $.isArray(dataSource) ? { data: dataSource } : dataSource;
dataSource = kendo.data.DataSource.create(dataSource);
if (that.dataSource) {
that.dataSource.unbind(CHANGE, that._refreshHandler);
+
+ value = that.value();
+
+ that.value([]);
+ that._bound = false;
+
+ that.value(value);
} else {
that._refreshHandler = proxy(that.refresh, that);
}
that.dataSource = dataSource.bind(CHANGE, that._refreshHandler);
+ that._fixedHeader();
},
setOptions: function(options) {
Widget.fn.setOptions.call(this, options);
- if (options.dataSource) {
- this.setDataSource(options.dataSource);
- }
-
-
- this._fixedHeader();
this._getter();
this._templates();
+ this._render();
},
destroy: function() {
@@ -21662,24 +22978,6 @@ var A = 0;
}
},
- _offsetHeight: function() {
- var offsetHeight = 0;
- var siblings = this.element.prevAll();
-
- siblings.each(function() {
- var element = $(this);
- if (element.is(":visible")) {
- if (element.hasClass("k-list-filter")) {
- offsetHeight += element.children().height();
- } else {
- offsetHeight += element.outerHeight();
- }
- }
- });
-
- return offsetHeight;
- },
-
scroll: function (item) {
if (!item) {
return;
@@ -21689,33 +22987,20 @@ var A = 0;
item = item[0];
}
- var ul = this.element[0],
+ var content = this.content[0],
itemOffsetTop = item.offsetTop,
itemOffsetHeight = item.offsetHeight,
- ulScrollTop = ul.scrollTop,
- ulOffsetHeight = ul.clientHeight,
- bottomDistance = itemOffsetTop + itemOffsetHeight,
- touchScroller = this._touchScroller,
- yDimension, offsetHeight;
-
- if (touchScroller) {
- yDimension = touchScroller.dimensions.y;
-
- if (yDimension.enabled && itemOffsetTop > yDimension.size) {
- itemOffsetTop = itemOffsetTop - yDimension.size + itemOffsetHeight + 4;
+ contentScrollTop = content.scrollTop,
+ contentOffsetHeight = content.clientHeight,
+ bottomDistance = itemOffsetTop + itemOffsetHeight;
- touchScroller.scrollTo(0, -itemOffsetTop);
- }
- } else {
- offsetHeight = this._offsetHeight();
- if (ulScrollTop > (itemOffsetTop - offsetHeight)) {
- ulScrollTop = (itemOffsetTop - offsetHeight);
- } else if (bottomDistance > (ulScrollTop + ulOffsetHeight + offsetHeight)) {
- ulScrollTop = (bottomDistance - ulOffsetHeight - offsetHeight);
+ if (contentScrollTop > itemOffsetTop) {
+ contentScrollTop = itemOffsetTop;
+ } else if (bottomDistance > (contentScrollTop + contentOffsetHeight)) {
+ contentScrollTop = (bottomDistance - contentOffsetHeight);
}
- ul.scrollTop = ulScrollTop;
- }
+ content.scrollTop = contentScrollTop;
},
selectedDataItems: function(dataItems) {
@@ -21732,7 +23017,7 @@ var A = 0;
});
},
- next: function() {
+ focusNext: function() {
var current = this.focus();
if (!current) {
@@ -21744,7 +23029,7 @@ var A = 0;
this.focus(current);
},
- prev: function() {
+ focusPrev: function() {
var current = this.focus();
if (!current) {
@@ -21756,11 +23041,11 @@ var A = 0;
this.focus(current);
},
- first: function() {
+ focusFirst: function() {
this.focus(this.element[0].children[0]);
},
- last: function() {
+ focusLast: function() {
this.focus(this.element[0].children[this.element[0].children.length - 1]);
},
@@ -21799,29 +23084,55 @@ var A = 0;
that.trigger("activate");
},
+ focusIndex: function() {
+ return this.focus() ? this.focus().index() : undefined;
+ },
+
+ filter: function(filter) {
+ if (filter === undefined) {
+ return this._filtered;
+ }
+
+ this._filtered = filter;
+ },
+
+ skipUpdate: function(skipUpdate) {
+ this._skipUpdate = skipUpdate;
+ },
+
select: function(indices) {
- var selectable = this.options.selectable;
+ var that = this;
+ var selectable = that.options.selectable;
var singleSelection = selectable !== "multiple" && selectable !== false;
+ var selectedIndices = that._selectedIndices;
var added = [];
var removed = [];
var result;
if (indices === undefined) {
- return this._selectedIndices.slice();
+ return selectedIndices.slice();
}
- indices = this._get(indices);
+ indices = that._get(indices);
if (indices.length === 1 && indices[0] === -1) {
indices = [];
}
- if (singleSelection && $.inArray(indices[indices.length - 1], this._selectedIndices) !== -1) {
+ if (that._filtered && !singleSelection && that._deselectFiltered(indices)) {
return;
}
- result = this._deselect(indices);
+ if (singleSelection && !that._filtered && $.inArray(indices[indices.length - 1], selectedIndices) !== -1) {
+ if (that._dataItems.length && that._view.length) {
+ that._dataItems = [that._view[selectedIndices[0]].item];
+ }
+
+ return;
+ }
+
+ result = that._deselect(indices);
removed = result.removed;
indices = result.indices;
@@ -21831,115 +23142,132 @@ var A = 0;
indices = [indices[indices.length - 1]];
}
- added = this._select(indices);
+ added = that._select(indices);
}
if (added.length || removed.length) {
- this.trigger("change", {
+ that._valueComparer = null;
+ that.trigger("change", {
added: added,
removed: removed
});
}
},
- value: function(value, silent) {
- var indices;
-
- if (value === undefined) {
- return this._values.slice();
- }
+ removeAt: function(position) {
+ this._selectedIndices.splice(position, 1);
+ this._values.splice(position, 1);
+ this._valueComparer = null;
- if (value === "" || value === null) {
- value = [];
- }
+ return {
+ position: position,
+ dataItem: this._dataItems.splice(position, 1)[0]
+ };
+ },
+ setValue: function(value) {
value = $.isArray(value) || value instanceof ObservableArray ? value.slice(0) : [value];
this._values = value;
- if (silent) {
- return;
- }
+ this._valueComparer = null;
+ },
- if (this.isBound()) {
- indices = this._valueIndices(value);
+ value: function(value) {
+ var that = this;
+ var deferred = that._valueDeferred;
+ var indices;
- if (!indices.length) {
- this.select([]);
- return;
- }
+ if (value === undefined) {
+ return that._values.slice();
+ }
- this._selectedIndices = [];
- this._dataItems = [];
- this._values = [];
+ that.setValue(value);
- this.select(indices);
+ if (!deferred || deferred.state() === "resolved") {
+ that._valueDeferred = deferred = $.Deferred();
}
- },
- data: function() {
- var that = this;
- var data = that._view;
- var length = data.length;
- var result = [];
- var idx;
+ if (that.isBound()) {
+ indices = that._valueIndices(that._values);
- if (length) {
- for (idx = 0; idx < length; idx++) {
- result.push(data[idx].item);
+ if (that.options.selectable === "multiple") {
+ that.select(-1);
}
+
+ that.select(indices);
+
+ deferred.resolve();
}
- return result;
- },
+ that._skipUpdate = false;
- clearIndices: function() {
- this._selectedIndices = [];
+ return deferred;
},
- filter: function(isFilter) {
- this._isFilter = isFilter;
+ items: function() {
+ return this.element.children(".k-item");
},
_click: function(e) {
if (!e.isDefaultPrevented()) {
- this.trigger("click", { item: $(e.currentTarget) });
+ if (!this.trigger("click", { item: $(e.currentTarget) })) {
+ this.select(e.currentTarget);
+ }
}
},
- _dataItemPosition: function(dataItem, values) {
- var value = this._valueGetter(dataItem);
- var index = -1;
+ _valueExpr: function(type, values) {
+ var that = this;
+ var value;
+ var idx = 0;
- for (var idx = 0; idx < values.length; idx++) {
- if (value == values[idx]) {
- index = idx;
- break;
+ var body;
+ var comparer;
+ var normalized = [];
+
+ if (!that._valueComparer || that._valueType !== type) {
+ that._valueType = type;
+
+ for (; idx < values.length; idx++) {
+ value = values[idx];
+
+ if (value !== undefined && value !== "" && value !== null) {
+ if (type === "boolean") {
+ value = Boolean(value);
+ } else if (type === "number") {
+ value = Number(value);
+ } else if (type === "string") {
+ value = value.toString();
+ }
+ }
+
+ normalized.push(value);
}
- }
- return index;
- },
+ body = "for (var idx = 0; idx < " + normalized.length + "; idx++) {" +
+ " if (current === values[idx]) {" +
+ " return idx;" +
+ " }" +
+ "} " +
+ "return -1;";
- _valueIndices: function(values) {
- var data = this._view;
- var indices = [];
- var idx = 0;
- var index;
+ comparer = new Function(["current", "values"], body);
- if (!values.length) {
- return [];
+ that._valueComparer = function(current) {
+ return comparer(current, normalized);
+ };
}
- for (; idx < data.length; idx++) {
- index = this._dataItemPosition(data[idx].item, values);
+ return that._valueComparer;
+ },
- if (index !== -1) {
- indices[index] = idx;
- }
- }
+ _dataItemPosition: function(dataItem, values) {
+ var value = this._valueGetter(dataItem);
- return this._normalizeIndices(indices);
+ var valueExpr = this._valueExpr(typeof value, values);
+
+ return valueExpr(value);
},
_getter: function() {
@@ -21947,15 +23275,19 @@ var A = 0;
},
_deselect: function(indices) {
- var children = this.element[0].children;
- var selectable = this.options.selectable;
- var selectedIndices = this._selectedIndices;
- var dataItems = this._dataItems;
- var values = this._values;
+ var that = this;
+ var children = that.element[0].children;
+ var selectable = that.options.selectable;
+ var selectedIndices = that._selectedIndices;
+ var dataItems = that._dataItems;
+ var values = that._values;
var removed = [];
var i = 0;
var j;
+ var index, selectedIndex;
+ var removedIndices = 0;
+
indices = indices.slice();
if (selectable === true || !indices.length) {
@@ -21968,13 +23300,10 @@ var A = 0;
});
}
- this._values = [];
- this._dataItems = [];
- this._selectedIndices = [];
+ that._values = [];
+ that._dataItems = [];
+ that._selectedIndices = [];
} else if (selectable === "multiple") {
- var index, selectedIndex;
- var removedIndices = 0;
-
for (; i < indices.length; i++) {
index = indices[i];
@@ -22012,15 +23341,45 @@ var A = 0;
};
},
- _select: function(indices) {
+ _deselectFiltered: function(indices) {
var children = this.element[0].children;
- var data = this._view;
+ var dataItem, index, position;
+ var removed = [];
+ var idx = 0;
+
+ for (; idx < indices.length; idx++) {
+ index = indices[idx];
+ dataItem = this._view[index].item;
+ position = this._dataItemPosition(dataItem, this._values);
+
+ if (position > -1) {
+ removed.push(this.removeAt(position));
+ $(children[index]).removeClass("k-state-selected");
+ }
+ }
+
+ if (removed.length) {
+ this.trigger("change", {
+ added: [],
+ removed: removed
+ });
+
+ return true;
+ }
+
+ return false;
+ },
+
+ _select: function(indices) {
+ var that = this;
+ var children = that.element[0].children;
+ var data = that._view;
var dataItem, index;
var added = [];
var idx = 0;
if (indices[indices.length - 1] !== -1) {
- this.focus(indices);
+ that.focus(indices);
}
for (; idx < indices.length; idx++) {
@@ -22033,9 +23392,9 @@ var A = 0;
dataItem = dataItem.item;
- this._selectedIndices.push(index);
- this._dataItems.push(dataItem);
- this._values.push(this._valueGetter(dataItem));
+ that._selectedIndices.push(index);
+ that._dataItems.push(dataItem);
+ that._values.push(that._valueGetter(dataItem));
$(children[index]).addClass("k-state-selected").attr("aria-selected", true);
@@ -22051,7 +23410,7 @@ var A = 0;
if (typeof candidate === "number") {
candidate = [candidate];
} else if (!isArray(candidate)) {
- candidate = $(candidate).data("index");
+ candidate = $(candidate).data("offset-index");
if (candidate === undefined) {
candidate = -1;
@@ -22111,17 +23470,40 @@ var A = 0;
return newIndices;
},
+ _valueIndices: function(values, indices) {
+ var data = this._view;
+ var idx = 0;
+ var index;
+
+ indices = indices ? indices.slice() : [];
+
+ if (!values.length) {
+ return [];
+ }
+
+ for (; idx < data.length; idx++) {
+ index = this._dataItemPosition(data[idx].item, values);
+
+ if (index !== -1) {
+ indices[index] = idx;
+ }
+ }
+
+ return this._normalizeIndices(indices);
+ },
+
_firstVisibleItem: function() {
var element = this.element[0];
- var scrollTop = element.scrollTop;
+ var content = this.content[0];
+ var scrollTop = content.scrollTop;
var itemHeight = $(element.children[0]).height();
var itemIndex = Math.floor(scrollTop / itemHeight) || 0;
- var item = element.children[itemIndex];
+ var item = element.children[itemIndex] || element.lastChild;
var forward = item.offsetTop < scrollTop;
while (item) {
if (forward) {
- if (item.offsetTop >= scrollTop || !item.nextSibling) {
+ if ((item.offsetTop + itemHeight) > scrollTop || !item.nextSibling) {
break;
}
@@ -22135,16 +23517,16 @@ var A = 0;
}
}
- return this._view[$(item).data("index")];
+ return this._view[$(item).data("offset-index")];
},
_fixedHeader: function() {
- if (this.dataSource.group().length && this.templates.fixedGroupTemplate) {
+ if (this.isGrouped() && this.templates.fixedGroupTemplate) {
this.header.show();
- this.element.scroll(this._onScroll);
+ this.content.scroll(this._onScroll);
} else {
this.header.hide();
- this.element.off("scroll", this._onScroll);
+ this.content.off("scroll", this._onScroll);
}
},
@@ -22161,25 +23543,26 @@ var A = 0;
}
},
- _renderItem: function(context, values) {
+ _renderItem: function(context) {
var item = '';
+ item += '"' + (selected ? ' aria-selected="true"' : "") + ' data-offset-index="' + context.index + '">';
item += this.templates.template(dataItem);
- if (context.newGroup) {
+ if (notFirstItem && context.newGroup) {
item += '' + this.templates.groupTemplate(context.group) + '
';
}
@@ -22197,7 +23580,7 @@ var A = 0;
var values = this.value();
var group, newGroup, j;
- var isGrouped = this.dataSource.group().length;
+ var isGrouped = this.isGrouped();
if (isGrouped) {
for (i = 0; i < view.length; i++) {
@@ -22205,21 +23588,26 @@ var A = 0;
newGroup = true;
for (j = 0; j < group.items.length; j++) {
- context = { item: group.items[j], group: group.value, newGroup: newGroup, index: idx };
+ context = {
+ selected: this._selected(group.items[j], values),
+ item: group.items[j],
+ group: group.value,
+ newGroup: newGroup,
+ index: idx };
dataContext[idx] = context;
idx += 1;
- html += this._renderItem(context, values);
+ html += this._renderItem(context);
newGroup = false;
}
}
} else {
for (i = 0; i < view.length; i++) {
- context = { item: view[i], index: i };
+ context = { selected: this._selected(view[i], values), item: view[i], index: i };
dataContext[i] = context;
- html += this._renderItem(context, values);
+ html += this._renderItem(context);
}
}
@@ -22232,41 +23620,79 @@ var A = 0;
}
},
- refresh: function() {
- this.trigger("dataBinding");
+ _selected: function(dataItem, values) {
+ var select = !this._filtered || this.options.selectable === "multiple";
+ return select && this._dataItemPosition(dataItem, values) !== -1;
+ },
- this._render();
+ refresh: function(e) {
+ var that = this;
+ var changedItems;
+ var action = e && e.action;
+
+ that.trigger("dataBinding");
+
+ that._fixedHeader();
- this._bound = true;
+ that._render();
- this.trigger("dataBound");
+ that._bound = true;
+
+ if (action === "itemchange") {
+ changedItems = findChangedItems(that._dataItems, e.items);
+ if (changedItems.length) {
+ that.trigger("selectedItemChange", {
+ items: changedItems
+ });
+ }
+ } else if (that._filtered || that._skipUpdate) {
+ that.focus(0);
+ if (that._skipUpdate) {
+ that._skipUpdate = false;
+ that._selectedIndices = that._valueIndices(that._values, that._selectedIndices);
+ }
+ } else if (!action || action === "add") {
+ that.value(that._values);
+ }
- if (!this._isFilter) {
- this.value(this._values);
+ if (that._valueDeferred) {
+ that._valueDeferred.resolve();
}
+
+ that.trigger("dataBound");
},
isBound: function() {
return this._bound;
+ },
+
+ isGrouped: function() {
+ return (this.dataSource.group() || []).length;
}
});
ui.plugin(StaticList);
- function inArray(node, parentNode) {
- var idx, length, siblings = parentNode.children;
+ function findChangedItems(selected, changed) {
+ var changedLength = changed.length;
+ var result = [];
+ var dataItem;
+ var i, j;
- if (!node || node.parentNode !== parentNode) {
- return -1;
- }
+ for (i = 0; i < selected.length; i++) {
+ dataItem = selected[i];
- for (idx = 0, length = siblings.length; idx < length; idx++) {
- if (node === siblings[idx]) {
- return idx;
+ for (j = 0; j < changedLength; j++) {
+ if (dataItem === changed[j]) {
+ result.push({
+ index: i,
+ item: dataItem
+ });
+ }
}
}
- return -1;
+ return result;
}
function removeFiltersForField(expression, field) {
@@ -23158,11 +24584,14 @@ var A = 0;
adjustDST(today, 0);
today = +today;
+ start = new DATE(start.getFullYear(), start.getMonth(), start.getDate());
+ adjustDST(start, 0);
+
return view({
cells: 42,
perRow: 7,
html: html += '
',
- start: new DATE(start.getFullYear(), start.getMonth(), start.getDate()),
+ start: start,
min: new DATE(min.getFullYear(), min.getMonth(), min.getDate()),
max: new DATE(max.getFullYear(), max.getMonth(), max.getDate()),
content: options.content,
@@ -23622,7 +25051,6 @@ var A = 0;
OPEN = "open",
CLOSE = "close",
CHANGE = "change",
- DATEVIEW = "dateView",
DISABLED = "disabled",
READONLY = "readonly",
DEFAULT = "k-state-default",
@@ -23630,7 +25058,6 @@ var A = 0;
SELECTED = "k-state-selected",
STATEDISABLED = "k-state-disabled",
HOVER = "k-state-hover",
- KEYDOWN = "keydown" + ns,
HOVEREVENTS = "mouseenter" + ns + " mouseleave" + ns,
MOUSEDOWN = "mousedown" + ns,
ID = "id",
@@ -23655,7 +25082,13 @@ var A = 0;
calendar.normalize(options);
+
parseFormats = $.isArray(parseFormats) ? parseFormats : [parseFormats];
+
+ if (!parseFormats.length) {
+ parseFormats.push("yyyy-MM-dd");
+ }
+
if ($.inArray(format, parseFormats) === -1) {
parseFormats.splice(0, 0, options.format);
}
@@ -23777,35 +25210,33 @@ var A = 0;
var that = this,
key = e.keyCode,
calendar = that.calendar,
- selectIsClicked = e.ctrlKey && key == keys.DOWN || key == keys.ENTER;
-
- if (key == keys.ESC) {
- that.close();
- return;
- }
+ selectIsClicked = e.ctrlKey && key == keys.DOWN || key == keys.ENTER,
+ handled = false;
if (e.altKey) {
if (key == keys.DOWN) {
that.open();
e.preventDefault();
+ handled = true;
} else if (key == keys.UP) {
that.close();
e.preventDefault();
+ handled = true;
}
- return;
- }
- if (!that.popup.visible()){
- return;
- }
+ } else if (that.popup.visible()) {
- if (selectIsClicked && calendar._cell.hasClass(SELECTED)) {
- that.close();
- e.preventDefault();
- return;
+ if (key == keys.ESC || (selectIsClicked && calendar._cell.hasClass(SELECTED))) {
+ that.close();
+ e.preventDefault();
+ return true;
+ }
+
+ that._current = calendar._move(e);
+ handled = true;
}
- that._current = calendar._move(e);
+ return handled;
},
current: function(date) {
@@ -23863,6 +25294,8 @@ var A = 0;
normalize(options);
+ that._initialOptions = extend({}, options);
+
that._wrapper();
that.dateView = new DateView(extend({}, options, {
@@ -23923,7 +25356,7 @@ var A = 0;
that._reset();
that._template();
- disabled = element.is("[disabled]");
+ disabled = element.is("[disabled]") || $(that.element).parents("fieldset").is(':disabled');
if (disabled) {
that.enable(false);
} else {
@@ -24113,23 +25546,32 @@ var A = 0;
that._old = value;
that._oldText = that.element.val();
- // trigger the DOM change event so any subscriber gets notified
- that.element.trigger(CHANGE);
+ if (!that._typing) {
+ // trigger the DOM change event so any subscriber gets notified
+ that.element.trigger(CHANGE);
+ }
that.trigger(CHANGE);
}
+
+ that._typing = false;
},
_keydown: function(e) {
var that = this,
dateView = that.dateView,
- value = that.element.val();
+ value = that.element.val(),
+ handled = false;
if (!dateView.popup.visible() && e.keyCode == keys.ENTER && value !== that._oldText) {
that._change(value);
} else {
- dateView.move(e);
+ handled = dateView.move(e);
that._updateARIA(dateView._current);
+
+ if (!handled) {
+ that._typing = true;
+ }
}
},
@@ -24235,6 +25677,8 @@ var A = 0;
if (form[0]) {
that._resetHandler = function() {
that.value(element[0].defaultValue);
+ that.max(that._initialOptions.max);
+ that.min(that._initialOptions.min);
};
that._form = form.on("reset", that._resetHandler);
@@ -24314,7 +25758,7 @@ var A = 0;
var AutoComplete = List.extend({
init: function (element, options) {
- var that = this, wrapper;
+ var that = this, wrapper, disabled;
that.ns = ns;
options = $.isArray(options) ? { dataSource: options} : options;
@@ -24345,6 +25789,7 @@ var A = 0;
.on("keydown" + ns, proxy(that._keydown, that))
.on("paste" + ns, proxy(that._search, that))
.on("focus" + ns, function () {
+ that._active = true;
that._prev = that._accessor();
that._placeholder(false);
wrapper.addClass(FOCUSED);
@@ -24352,6 +25797,7 @@ var A = 0;
.on("focusout" + ns, function () {
that._change();
that._placeholder();
+ that._active = false;
wrapper.removeClass(FOCUSED);
})
.attr({
@@ -24374,6 +25820,14 @@ var A = 0;
that._initList();
+ disabled = $(that.element).parents("fieldset").is(':disabled');
+
+ if (disabled) {
+ that.enable(false);
+ }
+
+ that.listView.bind("click", function(e) { e.preventDefault(); });
+
kendo.notify(that);
},
@@ -24382,6 +25836,8 @@ var A = 0;
enabled: true,
suggest: false,
template: "",
+ groupTemplate: "#:data#",
+ fixedGroupTemplate: "#:data#",
dataTextField: "",
minLength: 1,
delay: 200,
@@ -24395,7 +25851,6 @@ var A = 0;
value: null
},
- //Use Select._dataSource method here!
_dataSource: function() {
var that = this;
@@ -24409,7 +25864,6 @@ var A = 0;
.bind("progress", that._progressHandler);
},
- //TODO: Use Select.setDataSource method here
setDataSource: function(dataSource) {
this.options.dataSource = dataSource;
this._dataSource();
@@ -24428,10 +25882,13 @@ var A = 0;
],
setOptions: function(options) {
+ var listOptions = this._listOptions(options);
+
List.fn.setOptions.call(this, options);
- this.listView.setOptions(options);
+ listOptions.dataValueField = listOptions.dataTextField;
+ this.listView.setOptions(listOptions);
this._accessors();
this._aria();
},
@@ -24502,7 +25959,7 @@ var A = 0;
word = word || that._accessor();
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
if (separator) {
word = wordAtCaret(caret(that.element)[0], word, separator);
@@ -24513,6 +25970,7 @@ var A = 0;
if (!length || length >= options.minLength) {
that._open = true;
+ that.listView.filter(true);
that._filterSource({
value: ignoreCase ? word.toLowerCase() : word,
operator: options.filter,
@@ -24558,6 +26016,7 @@ var A = 0;
value = words[wordIndex].substring(0, idx);
if (word) {
+ word = word.toString();
idx = word.toLowerCase().indexOf(value.toLowerCase());
if (idx > -1) {
word = word.substring(idx + value.length);
@@ -24597,6 +26056,8 @@ var A = 0;
var item = e.item;
var element = this.element;
+ this._active = true;
+
if (this.trigger("select", { item: item })) {
this.close();
return;
@@ -24610,74 +26071,67 @@ var A = 0;
_initList: function() {
var that = this;
- var options = this.options;
- var template = options.template || options.itemTemplate || "#:" + kendo.expr(options.dataTextField, "data") + "#";
+ var virtual = that.options.virtual;
+ var hasVirtual = !!virtual;
+
+ var listBoundHandler = proxy(that._listBound, that);
var listOptions = {
autoBind: false,
- height: options.height,
- dataValueField: options.dataValueField,
- dataSource: this.dataSource,
- groupTemplate: options.groupTemplate || "#:data#",
- fixedGroupTemplate: options.fixedGroupTemplate || "#:data#",
- template: template,
selectable: true,
- activate: function() {
- var current = this.focus();
- if (current) {
- that._focused.add(that.filterInput).attr("aria-activedescendant", current.attr("id"));
- }
- },
- click: $.proxy(this._click, this),
- change: $.proxy(this._listChange, this),
- deactivate: function() {
- that._focused.add(that.filterInput).removeAttr("aria-activedescendant");
- },
+ dataSource: that.dataSource,
+ click: $.proxy(that._click, this),
+ change: $.proxy(that._listChange, this),
+ activate: proxy(that._activateItem, that),
+ deactivate: proxy(that._deactivateItem, that),
dataBinding: function() {
- that.trigger("dataBinding"); //TODO: make preventable
+ that.trigger("dataBinding");
that._angularItems("cleanup");
},
- listBound: $.proxy(this._listBound, this),
- dataBound: $.proxy(this._listBound, this)
+ dataBound: listBoundHandler,
+ listBound: listBoundHandler
};
- if (options.virtual) {
- if (typeof options.virtual === "object") {
- $.extend(listOptions, {
- listBound: $.proxy(this._listBound, this)
- }, options.virtual);
- }
+ listOptions = $.extend(that._listOptions(), listOptions, typeof virtual === "object" ? virtual : {});
+
+ listOptions.dataValueField = listOptions.dataTextField;
- this.listView = new kendo.ui.VirtualList(this.ul, listOptions);
+ if (!hasVirtual) {
+ that.listView = new kendo.ui.StaticList(that.ul, listOptions);
} else {
- this.listView = new kendo.ui.StaticList(this.ul, listOptions);
+ that.listView = new kendo.ui.VirtualList(that.ul, listOptions);
}
- this.listView.value(this.options.value);
+ that.listView.value(that.options.value);
},
_listBound: function() {
var that = this;
var popup = that.popup;
var options = that.options;
- var data = that.listView.data();
+ var data = that.dataSource.flatView();
var length = data.length;
var isActive = that.element[0] === activeElement();
var action;
that._angularItems("compile");
+ if (that._open) {
+ that.listView.value([]);
+ that.listView.focus(-1);
+ }
+
+ that.listView.filter(false);
+
that._calculateGroupPadding(that._height(length));
- if (popup.visible()) {
- popup._position();
- }
+ popup.position();
if (length) {
var current = this.listView.focus();
if (options.highlightFirst && !current) {
- that.listView.first();
+ that.listView.focusFirst();
}
if (options.suggest && isActive) {
@@ -24689,26 +26143,28 @@ var A = 0;
that._open = false;
action = length ? "open" : "close";
- if (that._typing && !isActive) {
+ if (that._typingTimeout && !isActive) {
action = "close";
}
popup[action]();
- that._typing = undefined;
+ that._typingTimeout = undefined;
}
if (that._touchScroller) {
that._touchScroller.reset();
}
+ that._hideBusy();
that._makeUnselectable();
- that._hideBusy();
that.trigger("dataBound");
},
_listChange: function() {
- this._selectValue(this.listView.selectedDataItems()[0]);
+ if (!this.listView.filter() && this._active) {
+ this._selectValue(this.listView.selectedDataItems()[0]);
+ }
},
_selectValue: function(dataItem) {
@@ -24764,12 +26220,12 @@ var A = 0;
if (key === keys.DOWN) {
if (visible) {
- this._move(current ? "next" : "first");
+ this._move(current ? "focusNext" : "focusFirst");
}
e.preventDefault();
} else if (key === keys.UP) {
if (visible) {
- this._move(current ? "prev" : "last");
+ this._move(current ? "focusPrev" : "focusLast");
}
e.preventDefault();
} else if (key === keys.ENTER || key === keys.TAB) {
@@ -24794,6 +26250,7 @@ var A = 0;
that.close();
} else {
that._search();
+ that._typing = true;
}
},
@@ -24866,9 +26323,9 @@ var A = 0;
_search: function () {
var that = this;
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
- that._typing = setTimeout(function () {
+ that._typingTimeout = setTimeout(function () {
if (that._prev !== that._accessor()) {
that._prev = that._accessor();
that.search();
@@ -24927,8 +26384,9 @@ var A = 0;
var kendo = window.kendo,
ui = kendo.ui,
Select = ui.Select,
- os = kendo.support.mobileOS,
+ support = kendo.support,
activeElement = kendo._activeElement,
+ ObservableObject = kendo.data.ObservableObject,
keys = kendo.keys,
ns = ".kendoDropDownList",
DISABLED = "disabled",
@@ -24939,7 +26397,6 @@ var A = 0;
STATEDISABLED = "k-state-disabled",
ARIA_DISABLED = "aria-disabled",
ARIA_READONLY = "aria-readonly",
- SELECTED = "k-state-selected",
HOVEREVENTS = "mouseenter" + ns + " mouseleave" + ns,
TABINDEX = "tabindex",
STATE_FILTER = "filter",
@@ -24950,7 +26407,7 @@ var A = 0;
init: function(element, options) {
var that = this;
var index = options && options.index;
- var optionLabel, useOptionLabel, text;
+ var optionLabel, text, disabled;
that.ns = ns;
options = $.isArray(options) ? { dataSource: options } : options;
@@ -24960,12 +26417,14 @@ var A = 0;
options = that.options;
element = that.element.on("focus" + ns, proxy(that._focusHandler, that));
+ that._focusInputHandler = $.proxy(that._focusInput, that);
that._inputTemplate();
that._reset();
that._prev = "";
that._word = "";
+ that.optionLabel = $();
that._wrapper();
@@ -24979,6 +26438,7 @@ var A = 0;
that._mobile();
that._dataSource();
+
that._ignoreCase();
that._filterHeader();
@@ -25005,22 +26465,25 @@ var A = 0;
text = options.text || "";
if (!text) {
optionLabel = options.optionLabel;
- useOptionLabel = optionLabel && options.index === 0;
- if (that._isSelect) {
- if (useOptionLabel) {
- text = optionLabel;
- } else {
- text = element.children(":selected").text();
- }
- } else if (!element[0].value && useOptionLabel) {
+ if (optionLabel && options.index === 0) {
text = optionLabel;
+ } else if (that._isSelect) {
+ text = element.children(":selected").text();
}
}
that._textAccessor(text);
}
+ disabled = $(that.element).parents("fieldset").is(':disabled');
+
+ if (disabled) {
+ that.enable(false);
+ }
+
+ that.listView.bind("click", function(e) { e.preventDefault(); });
+
kendo.notify(that);
},
@@ -25046,9 +26509,10 @@ var A = 0;
template: null,
valueTemplate: null,
optionLabelTemplate: null,
- groupTemplate: null,
- fixedGroupTemplate: null
+ groupTemplate: "#:data#",
+ fixedGroupTemplate: "#:data#"
},
+
events: [
"open",
"close",
@@ -25063,13 +26527,18 @@ var A = 0;
setOptions: function(options) {
Select.fn.setOptions.call(this, options);
- this.listView.setOptions(options);
+ this.listView.setOptions(this._listOptions(options));
+ this._optionLabel();
this._inputTemplate();
this._accessors();
this._filterHeader();
this._enable();
this._aria();
+
+ if (!this.value() && this.optionLabel[0]) {
+ this.select(0);
+ }
},
destroy: function() {
@@ -25094,88 +26563,33 @@ var A = 0;
return;
}
- if (!this.dataSource.view().length || that._state === STATE_ACCEPT) {
+ if (!that.listView.isBound() || that._state === STATE_ACCEPT) {
that._open = true;
that._state = "rebind";
- //that.listView.focus(false);
if (that.filterInput) {
that.filterInput.val("");
+ that._prev = "";
}
that._filterSource();
- } else {
+ } else if (that._allowOpening()) {
+ that.popup.one("activate", that._focusInputHandler);
that.popup.open();
- that._focusElement(that.filterInput);
that._focusItem();
}
},
- toggle: function(toggle) {
- this._toggle(toggle, true);
+ _focusInput: function () {
+ this._focusElement(this.filterInput);
},
- _initList: function() {
- var that = this;
- var options = this.options;
- var virtualOptions;
-
- if (options.virtual) {
- virtualOptions = {
- autoBind: false, //dropdownlist fetches the data
- dataValueField: options.dataValueField,
- dataSource: this.dataSource,
- selectable: true,
- height: this.options.height,
- groupTemplate: options.groupTemplate || "#:data#",
- fixedGroupTemplate: options.fixedGroupTemplate || "#:data#",
- template: options.template || "#:" + kendo.expr(options.dataTextField, "data") + "#",
- change: $.proxy(this._listChange, this),
- click: $.proxy(this._click, this),
- activate: function() {
- var current = this.focus();
- if (current) {
- that._focused.add(that.filterInput).attr("aria-activedescendant", current.attr("id"));
- }
- },
- deactivate: function() {
- that._focused.add(that.filterInput).removeAttr("aria-activedescendant");
- },
- listBound: $.proxy(this._listBound, this)
- };
-
- if (typeof options.virtual === "object") {
- $.extend(virtualOptions, options.virtual);
- }
-
- this.listView = new kendo.ui.VirtualList(this.ul, virtualOptions);
- } else {
- this.listView = new kendo.ui.StaticList(this.ul, {
- dataValueField: options.dataValueField,
- dataSource: this.dataSource,
- groupTemplate: options.groupTemplate || "#:data#",
- fixedGroupTemplate: options.fixedGroupTemplate || "#:data#",
- template: options.template || "#:" + kendo.expr(options.dataTextField, "data") + "#",
- activate: function() {
- var current = this.focus();
- if (current) {
- that._focused.add(that.filterInput).attr("aria-activedescendant", current.attr("id"));
- }
- },
- click: $.proxy(this._click, this),
- change: $.proxy(this._listChange, this),
- deactivate: function() {
- that._focused.add(that.filterInput).removeAttr("aria-activedescendant");
- },
- dataBinding: function() {
- that.trigger("dataBinding");
- that._angularItems("cleanup");
- },
- dataBound: $.proxy(this._listBound, this)
- });
- }
+ _allowOpening: function() {
+ return this.optionLabel[0] || this.filterInput || this.dataSource.view().length;
+ },
- this.listView.value(this.options.value);
+ toggle: function(toggle) {
+ this._toggle(toggle, true);
},
current: function(candidate) {
@@ -25196,25 +26610,31 @@ var A = 0;
dataItem: function(index) {
var that = this;
- var dataItem;
+ var dataItem = null;
+ var hasOptionLabel = !!that.optionLabel[0];
+ var optionLabel = that.options.optionLabel;
if (index === undefined) {
dataItem = that.listView.selectedDataItems()[0];
-
- if (!dataItem && this.optionLabel[0]) {
- dataItem = {};
- assign(dataItem, that.options.dataTextField.split("."), that._optionLabelText());
- assign(dataItem, that.options.dataValueField.split("."), "");
+ } else {
+ if (typeof index !== "number") {
+ if (index.hasClass("k-list-optionlabel")) {
+ index = -1;
+ } else {
+ index = $(that.items()).index(index);
+ }
+ } else if (hasOptionLabel) {
+ index -= 1;
}
- return dataItem;
+ dataItem = that.dataSource.flatView()[index];
}
- if (typeof index !== "number") {
- index = $(that.items()).index(index);
+ if (!dataItem && hasOptionLabel) {
+ dataItem = $.isPlainObject(optionLabel) ? new ObservableObject(optionLabel) : that._assignInstance(that._optionLabelText(), "");
}
- return that.listView.data()[index];
+ return dataItem;
},
refresh: function() {
@@ -25257,25 +26677,38 @@ var A = 0;
value: function(value) {
var that = this;
+ var dataSource = that.dataSource;
if (value === undefined) {
value = that._accessor() || that.listView.value()[0];
return value === undefined || value === null ? "" : value;
}
- if (value === null) {
- value = "";
+ if (value) {
+ that._initialIndex = null;
+ }
+
+ if (that._request && that.options.cascadeFrom && that.listView.isBound()) {
+ if (that._valueSetter) {
+ dataSource.unbind(CHANGE, that._valueSetter);
+ }
+
+ that._valueSetter = proxy(function() { that.value(value); }, that);
+
+ dataSource.one(CHANGE, that._valueSetter);
+ return;
}
- value = value.toString();
+ that.listView.value(value).done(function() {
+ if (that.selectedIndex === -1 && that.text()) {
+ that.text("");
+ that._accessor("", -1);
+ }
- that.listView.one("change", function() {
that._old = that._accessor();
that._oldIndex = that.selectedIndex;
});
- that.listView.value(value);
-
that._fetchData();
},
@@ -25286,6 +26719,7 @@ var A = 0;
var template = options.optionLabelTemplate;
if (!optionLabel) {
+ that.optionLabel.off().remove();
that.optionLabel = $();
return;
}
@@ -25307,9 +26741,15 @@ var A = 0;
}
that.optionLabelTemplate = template;
- that.optionLabel = $('' + template(optionLabel) + '
')
- .prependTo(that.list)
- .click($.proxy(this._click, this));
+
+ if (!that.optionLabel[0]) {
+ that.optionLabel = $('').prependTo(that.list);
+ }
+
+ that.optionLabel.html(template(optionLabel))
+ .off()
+ .click(proxy(that._click, that))
+ .on(HOVEREVENTS, that._toggleHover);
that.angular("compile", function(){
return { elements: that.optionLabel };
@@ -25323,76 +26763,78 @@ var A = 0;
_listBound: function() {
var that = this;
- var data = that.listView.data();
- var length = data.length;
+ var initialIndex = that._initialIndex;
var optionLabel = that.options.optionLabel;
var filtered = that._state === STATE_FILTER;
- var element = that.element[0];
- var selectedIndex;
+
+ var data = that.dataSource.flatView();
+ var length = data.length;
+ var dataItem;
+
var height;
var value;
that._angularItems("compile");
+ that._presetValue = false;
+
if (!that.options.virtual) {
height = that._height(filtered ? (length || 1) : length);
that._calculateGroupPadding(height);
}
- if (that.popup.visible()) {
- that.popup._position();
- }
+ that.popup.position();
if (that._isSelect) {
- selectedIndex = element.selectedIndex;
value = that.value();
if (length) {
if (optionLabel) {
- optionLabel = that._option("", this._optionLabelText());
+ optionLabel = that._option("", that._optionLabelText());
}
} else if (value) {
- selectedIndex = 0;
optionLabel = that._option(value, that.text());
}
- that._options(data, optionLabel);
- element.selectedIndex = selectedIndex === -1 ? 0 : selectedIndex;
+ that._options(data, optionLabel, value);
}
- that._hideBusy();
that._makeUnselectable();
if (!filtered) {
if (that._open) {
- that.toggle(!!length);
+ that.toggle(that._allowOpening());
}
that._open = false;
if (!that._fetch) {
if (length) {
- if (!this.listView.value().length && this._initialIndex > -1 && this._initialIndex !== null) {
- this.select(this._initialIndex);
+ if (!that.listView.value().length && initialIndex > -1 && initialIndex !== null) {
+ that.select(initialIndex);
}
- this._initialIndex = null;
- } else if (this._textAccessor() !== optionLabel) {
- this.listView.value("");
- this._selectValue(null);
+ that._initialIndex = null;
+ dataItem = that.listView.selectedDataItems()[0];
+ if (dataItem && that.text() !== that._text(dataItem)) {
+ that._selectValue(dataItem);
+ }
+ } else if (that._textAccessor() !== that._optionLabelText()) {
+ that.listView.value("");
+ that._selectValue(null);
+ that._oldIndex = that.selectedIndex;
}
}
- } else {
- this.listView.first();
}
+ that._hideBusy();
that.trigger("dataBound");
},
_listChange: function() {
this._selectValue(this.listView.selectedDataItems()[0]);
- if (this._old && this._oldIndex === -1) {
+ if (this._presetValue || (this._old && this._oldIndex === -1)) {
this._oldIndex = this.selectedIndex;
}
},
@@ -25410,19 +26852,16 @@ var A = 0;
var that = this;
var filtered = that._state === STATE_FILTER;
var isIFrame = window.self !== window.top;
+ var focusedItem = that._focus();
if (!that._prevent) {
- clearTimeout(that._typing);
-
- if (filtered) {
- that._select(that._focus(), !that.listView.dataItems()[0]);
- }
+ clearTimeout(that._typingTimeout);
- if (!filtered || that.dataItem()) {
- //that._triggerCascade();
+ if (filtered && focusedItem && !that.trigger("select", { item: focusedItem })) {
+ that._select(focusedItem, !that.dataSource.view().length);
}
- if (kendo.support.mobileOS.ios && isIFrame) {
+ if (support.mobileOS.ios && isIFrame) {
that._change();
} else {
that._blur();
@@ -25441,6 +26880,7 @@ var A = 0;
_wrapperClick: function(e) {
e.preventDefault();
+ this.popup.unbind("activate", this._focusInputHandler);
this._focused = this.wrapper;
this._toggle();
},
@@ -25506,13 +26946,25 @@ var A = 0;
var that = this;
var key = e.keyCode;
var altKey = e.altKey;
- var ul = that.ul[0];
+ var isInputActive;
var handled;
+ var isPopupVisible = that.popup.visible();
+
+ if (that.filterInput) {
+ isInputActive = that.filterInput[0] === activeElement();
+ }
+
if (key === keys.LEFT) {
key = keys.UP;
+ handled = true;
} else if (key === keys.RIGHT) {
key = keys.DOWN;
+ handled = true;
+ }
+
+ if (handled && isInputActive) {
+ return;
}
e.keyCode = key;
@@ -25521,13 +26973,18 @@ var A = 0;
that._focusElement(that.wrapper);
}
+ if (key === keys.ENTER && that._typingTimeout && that.filterInput && isPopupVisible) {
+ e.preventDefault();
+ return;
+ }
+
handled = that._move(e);
if (handled) {
return;
}
- if (!that.popup.visible() || !that.filterInput) {
+ if (!isPopupVisible || !that.filterInput) {
if (key === keys.HOME) {
handled = true;
that._firstItem();
@@ -25547,30 +27004,44 @@ var A = 0;
}
},
- _selectNext: function(word, index) {
- var that = this, text,
- startIndex = index,
- data = that.listView.data(),
- length = data.length,
- ignoreCase = that.options.ignoreCase,
- action = function(text, index) {
- text = text + "";
- if (ignoreCase) {
- text = text.toLowerCase();
- }
+ _matchText: function(text, index) {
+ var that = this;
+ var ignoreCase = that.options.ignoreCase;
+ var found = false;
- if (text.indexOf(word) === 0) {
- that._select(index);
- if (!that.popup.visible()) {
- that._change();
- }
- return true;
- }
- };
+ text = text + "";
+
+ if (ignoreCase) {
+ text = text.toLowerCase();
+ }
+
+ if (text.indexOf(that._word) === 0) {
+ if (that.optionLabel[0]) {
+ index += 1;
+ }
+
+ that._select(index);
+ if (!that.popup.visible()) {
+ that._change();
+ }
+
+ found = true;
+ }
+
+ return found;
+ },
+
+ _selectNext: function(index) {
+ var that = this;
+ var startIndex = index;
+ var data = that.dataSource.flatView();
+ var length = data.length;
+ var text;
for (; index < length; index++) {
text = that._text(data[index]);
- if (text && action(text, index)) {
+
+ if (text && that._matchText(text, index) && !(that._word.length === 1 && startIndex === that.selectedIndex)) {
return true;
}
}
@@ -25579,7 +27050,7 @@ var A = 0;
index = 0;
for (; index <= startIndex; index++) {
text = that._text(data[index]);
- if (text && action(text, index)) {
+ if (text && that._matchText(text, index)) {
return true;
}
}
@@ -25597,7 +27068,7 @@ var A = 0;
var character = String.fromCharCode(e.charCode || e.keyCode);
var index = that.selectedIndex;
- var word = that._word;
+ var length = that._word.length;
if (that.options.ignoreCase) {
character = character.toLowerCase();
@@ -25607,17 +27078,20 @@ var A = 0;
e.preventDefault();
}
- if (that._last === character && word.length <= 1 && index > -1) {
- if (!word) {
- word = character;
- }
+ if (!length) {
+ that._word = character;
+ }
- if (that._selectNext(word, index + 1)) {
+ if (that._last === character && length <= 1 && index > -1) {
+ if (that._selectNext(index)) {
return;
}
}
- that._word = word + character;
+ if (length) {
+ that._word += character;
+ }
+
that._last = character;
that._search();
@@ -25639,7 +27113,7 @@ var A = 0;
this.popup.one("open", proxy(this._popupOpen, this));
},
- _click: function(e) {
+ _click: function (e) {
var item = e.item || $(e.currentTarget);
if (this.trigger("select", { item: item })) {
@@ -25660,6 +27134,11 @@ var A = 0;
var wrapper = this.wrapper;
var filterInput = this.filterInput;
var compareElement = element === filterInput ? wrapper : filterInput;
+ var touchEnabled = support.mobileOS && (support.touch || support.MSPointers || support.pointers);
+
+ if (filterInput && filterInput[0] === element[0] && touchEnabled) {
+ return;
+ }
if (filterInput && compareElement[0] === active) {
this._prevent = true;
@@ -25692,15 +27171,14 @@ var A = 0;
},
_search: function() {
- var that = this,
- dataSource = that.dataSource,
- index = that.selectedIndex,
- word = that._word;
+ var that = this;
+ var dataSource = that.dataSource;
+ var index = that.selectedIndex;
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
if (that.options.filter !== "none") {
- that._typing = setTimeout(function() {
+ that._typingTimeout = setTimeout(function() {
var value = that.filterInput.val();
if (that._prev !== value) {
@@ -25708,10 +27186,10 @@ var A = 0;
that.search(value);
}
- that._typing = null;
+ that._typingTimeout = null;
}, that.options.delay);
} else {
- that._typing = setTimeout(function() {
+ that._typingTimeout = setTimeout(function() {
that._word = "";
}, that.options.delay);
@@ -25720,31 +27198,35 @@ var A = 0;
}
if (!that.ul[0].firstChild) {
- dataSource.one(CHANGE, function () {
+ dataSource.fetch().done(function () {
if (dataSource.data()[0] && index > -1) {
- that._selectNext(word, index);
+ that._selectNext(index);
}
- }).fetch();
+ });
return;
}
- that._selectNext(word, index);
+ that._selectNext(index);
}
},
_get: function(candidate) {
var data, found, idx;
+ var isFunction = typeof candidate === "function";
+ var jQueryCandidate = !isFunction ? $(candidate) : $();
if (this.optionLabel[0]) {
if (typeof candidate === "number") {
- candidate -= 1;
- } else if (candidate instanceof jQuery && candidate.hasClass("k-list-optionlabel")) {
+ if (candidate > -1) {
+ candidate -= 1;
+ }
+ } else if (jQueryCandidate.hasClass("k-list-optionlabel")) {
candidate = -1;
}
}
- if (typeof candidate === "function") {
- data = this.listView.data();
+ if (isFunction) {
+ data = this.dataSource.flatView();
for (idx = 0; idx < data.length; idx++) {
if (candidate(data[idx])) {
@@ -25766,21 +27248,21 @@ var A = 0;
if (this.optionLabel[0]) {
this._focus(this.optionLabel);
} else {
- this.listView.first();
+ this.listView.focusFirst();
}
},
_lastItem: function() {
this.optionLabel.removeClass("k-state-focused");
- this.listView.last();
+ this.listView.focusLast();
},
_nextItem: function() {
if (this.optionLabel.hasClass("k-state-focused")) {
this.optionLabel.removeClass("k-state-focused");
- this.listView.first();
+ this.listView.focusFirst();
} else {
- this.listView.next();
+ this.listView.focusNext();
}
},
@@ -25789,7 +27271,7 @@ var A = 0;
return;
}
- this.listView.prev();
+ this.listView.focusPrev();
if (!this.listView.focus()) {
this.optionLabel.addClass("k-state-focused");
}
@@ -25845,75 +27327,76 @@ var A = 0;
},
_select: function(candidate, keepState) {
- var optionLabel = this.optionLabel;
+ var that = this;
- candidate = this._get(candidate);
+ candidate = that._get(candidate);
- if (!keepState && this._state === STATE_FILTER) {
- this.listView.clearIndices();
- this.listView.filter(false);
+ that.listView.select(candidate);
- this._state = STATE_ACCEPT;
+ if (!keepState && that._state === STATE_FILTER) {
+ that.listView.filter(false);
+ that._state = STATE_ACCEPT;
}
- optionLabel.removeClass("k-state-focused k-state-selected");
-
- this.listView.select(candidate);
-
if (candidate === -1) {
- this._selectValue(null);
- this._focus(optionLabel.addClass("k-state-selected"));
+ that._selectValue(null);
}
},
_selectValue: function(dataItem) {
+ var that = this;
+ var optionLabel = that.options.optionLabel;
+ var labelElement = that.optionLabel;
+ var idx = that.listView.select();
+
var value = "";
var text = "";
- var idx = this.listView.select();
- var optionLabel = this.options.optionLabel;
idx = idx[idx.length - 1];
if (idx === undefined) {
idx = -1;
}
+ labelElement.removeClass("k-state-focused k-state-selected");
+
if (dataItem) {
text = dataItem;
- value = this._dataValue(dataItem);
+ value = that._dataValue(dataItem);
if (optionLabel) {
idx += 1;
}
} else if (optionLabel) {
- this._focus(this.optionLabel);
- text = this._optionLabelText();
+ that._focus(labelElement.addClass("k-state-selected"));
+ text = that._optionLabelText();
if (typeof optionLabel === "string") {
value = "";
} else {
- value = this._value(optionLabel);
+ value = that._value(optionLabel);
}
idx = 0;
}
- this.selectedIndex = idx;
+ that.selectedIndex = idx;
if (value === null) {
value = "";
}
- this._textAccessor(text);
- this._accessor(value, idx);
+ that._textAccessor(text);
+ that._accessor(value, idx);
- this._triggerCascade();
+ that._triggerCascade();
},
_mobile: function() {
var that = this,
popup = that.popup,
+ mobileOS = support.mobileOS,
root = popup.element.parents(".km-root").eq(0);
- if (root.length && os) {
- popup.options.animation.open.effects = (os.android || os.meego) ? "fadeIn" : (os.ios || os.wp) ? "slideIn:up" : popup.options.animation.open.effects;
+ if (root.length && mobileOS) {
+ popup.options.animation.open.effects = (mobileOS.android || mobileOS.meego) ? "fadeIn" : (mobileOS.ios || mobileOS.wp) ? "slideIn:up" : popup.options.animation.open.effects;
}
},
@@ -25978,6 +27461,7 @@ var A = 0;
if (!wrapper.is("span.k-widget")) {
wrapper = element.wrap("").parent();
wrapper[0].style.cssText = DOMelement.style.cssText;
+ wrapper[0].title = DOMelement.title;
}
element.hide();
@@ -25994,18 +27478,8 @@ var A = 0;
});
},
- _clearSelection: function() {
- var that = this;
- var optionLabel = that.options.optionLabel;
-
- that.options.value = "";
-
- if (that.dataSource.view()[0] && (optionLabel || that._userTriggered)) {
- that.select(0);
- } else {
- that.select(-1);
- that._textAccessor(that.options.optionLabel);
- }
+ _clearSelection: function(parent) {
+ this.select(parent.value() ? 0 : -1);
},
_inputTemplate: function() {
@@ -26023,28 +27497,22 @@ var A = 0;
},
_textAccessor: function(text) {
- var dataItem = this.listView.selectedDataItems()[0];
+ var dataItem = null;
var template = this.valueTemplate;
var options = this.options;
var optionLabel = options.optionLabel;
var span = this.span;
if (text !== undefined) {
- if ($.isPlainObject(text) || text instanceof kendo.data.ObservableObject) {
+ if ($.isPlainObject(text) || text instanceof ObservableObject) {
dataItem = text;
} else if (optionLabel && this._optionLabelText() === text) {
dataItem = optionLabel;
template = this.optionLabelTemplate;
}
- if (dataItem === undefined) {
- if (options.dataTextField) {
- dataItem = {};
- assign(dataItem, options.dataTextField.split("."), text);
- assign(dataItem, options.dataValueField.split("."), this._accessor());
- } else {
- dataItem = text;
- }
+ if (!dataItem) {
+ dataItem = this._assignInstance(text, this._accessor());
}
var getElements = function(){
@@ -26059,6 +27527,38 @@ var A = 0;
} else {
return span.text();
}
+ },
+
+ _preselect: function(value, text) {
+ if (!value && !text) {
+ text = this._optionLabelText();
+ }
+
+ this._accessor(value);
+ this._textAccessor(text);
+
+ this._old = this._accessor();
+ this._oldIndex = this.selectedIndex;
+
+ this.listView.setValue(value);
+
+ this._initialIndex = null;
+ this._presetValue = true;
+ },
+
+ _assignInstance: function(text, value) {
+ var dataTextField = this.options.dataTextField;
+ var dataItem = {};
+
+ if (dataTextField) {
+ assign(dataItem, dataTextField.split("."), text);
+ assign(dataItem, this.options.dataValueField.split("."), value);
+ dataItem = new ObservableObject(dataItem);
+ } else {
+ dataItem = text;
+ }
+
+ return dataItem;
}
});
@@ -26108,17 +27608,15 @@ var A = 0;
STATEDISABLED = "k-state-disabled",
ARIA_DISABLED = "aria-disabled",
ARIA_READONLY = "aria-readonly",
- STATE_SELECTED = "k-state-selected",
STATE_FILTER = "filter",
STATE_ACCEPT = "accept",
STATE_REBIND = "rebind",
HOVEREVENTS = "mouseenter" + ns + " mouseleave" + ns,
- NULL = null,
proxy = $.proxy;
var ComboBox = Select.extend({
init: function(element, options) {
- var that = this, text;
+ var that = this, text, disabled;
that.ns = ns;
@@ -26157,7 +27655,7 @@ var A = 0;
that._cascade();
if (options.autoBind) {
- that._filterSource(); //TODO: diff when just bind and actually filter
+ that._filterSource();
} else {
text = options.text;
@@ -26175,6 +27673,12 @@ var A = 0;
that._placeholder();
}
+ disabled = $(that.element).parents("fieldset").is(':disabled');
+
+ if (disabled) {
+ that.enable(false);
+ }
+
kendo.notify(that);
},
@@ -26199,10 +27703,8 @@ var A = 0;
ignoreCase: true,
animation: {},
template: null,
- valueTemplate: null,
- optionLabelTemplate: null,
- groupTemplate: null,
- fixedGroupTemplate: null
+ groupTemplate: "#:data#",
+ fixedGroupTemplate: "#:data#"
},
events:[
@@ -26252,8 +27754,8 @@ var A = 0;
var that = this;
that._inputWrapper.removeClass(FOCUSED);
- clearTimeout(that._typing);
- that._typing = null;
+ clearTimeout(that._typingTimeout);
+ that._typingTimeout = null;
if (that.options.text !== that.input.val()) {
that.text(that.text());
@@ -26307,14 +27809,12 @@ var A = 0;
open: function() {
var that = this;
var state = that._state;
- var focusedItem;
- var index;
if (that.popup.visible()) {
return;
}
- if ((!this.dataSource.view().length && state !== STATE_FILTER) || state === STATE_ACCEPT) {
+ if ((!that.listView.isBound() && state !== STATE_FILTER) || state === STATE_ACCEPT) {
that._open = true;
that._state = STATE_REBIND;
that.listView.filter(false);
@@ -26325,71 +27825,29 @@ var A = 0;
}
},
- _initList: function() {
- var that = this;
- var options = this.options;
- var listOptions = {
- autoBind: false,
- selectable: true,
- height: options.height,
- dataValueField: options.dataValueField,
- dataSource: this.dataSource,
- groupTemplate: options.groupTemplate || "#:data#",
- fixedGroupTemplate: options.fixedGroupTemplate || "#:data#",
- template: options.template || "#:" + kendo.expr(options.dataTextField, "data") + "#",
- activate: function() {
- var current = this.focus();
- if (current) {
- that._focused.add(that.filterInput).attr("aria-activedescendant", current.attr("id"));
- }
- },
- click: $.proxy(this._click, this),
- change: $.proxy(this._listChange, this),
- deactivate: function() {
- that._focused.add(that.filterInput).removeAttr("aria-activedescendant");
- },
- dataBinding: function() {
- that.trigger("dataBinding"); //TODO: make preventable
- that._angularItems("cleanup");
- },
- listBound: $.proxy(this._listBound, this),
- dataBound: $.proxy(this._listBound, this)
- };
-
- if (options.virtual) {
- if (typeof options.virtual === "object") {
- $.extend(listOptions, {
- listBound: $.proxy(this._listBound, this)
- }, options.virtual);
- }
-
- this.listView = new kendo.ui.VirtualList(this.ul, listOptions);
- } else {
- this.listView = new kendo.ui.StaticList(this.ul, listOptions);
- }
-
- this.listView.value(this.options.value);
- },
-
_listBound: function() {
var that = this;
var options = that.options;
- var data = that.listView.data();
- var length = data.length;
- var isActive = that.input[0] === activeElement();
+ var initialIndex = that._initialIndex;
var filtered = that._state === STATE_FILTER;
- var current;
- var value;
+ var isActive = that.input[0] === activeElement();
+
+ var listView = that.listView;
+ var focusedItem = listView.focus();
+ var data = this.dataSource.flatView();
+ var page = this.dataSource.page();
+ var length = data.length;
+ var dataItem;
that._angularItems("compile");
+ that._presetValue = false;
+
if (!options.virtual) {
that._calculateGroupPadding(that._height(length));
}
- if (that.popup.visible()) {
- that.popup._position();
- }
+ that.popup.position();
if (that._isSelect) {
var hasChild = that.element[0].children[0];
@@ -26402,7 +27860,7 @@ var A = 0;
var custom = that._customOption;
that._customOption = undefined;
- that._options(data);
+ that._options(data, "", that.value());
if (custom && custom[0].selected) {
that._custom(custom.val(), keepState);
@@ -26411,32 +27869,38 @@ var A = 0;
}
}
- that._hideBusy();
that._makeUnselectable();
if (!filtered && !that._fetch) {
- if (!this.listView.value().length) {
- if (this._initialIndex > -1 && this._initialIndex !== null) {
- this.select(this._initialIndex);
- } else if (this._accessor()) {
- this.listView.value(this._accessor());
+ if (!listView.value().length) {
+ if (initialIndex !== null && initialIndex > -1) {
+ that.select(initialIndex);
+ focusedItem = listView.focus();
+ } else if (that._accessor()) {
+ listView.value(that._accessor());
}
}
- this._initialIndex = null;
- } else if (filtered) {
- current = this.listView.focus();
- if (current) {
- current.removeClass("k-state-selected");
+ that._initialIndex = null;
+
+ dataItem = that.listView.selectedDataItems()[0];
+ if (dataItem && that.text() && that.text() !== that._text(dataItem)) {
+ that._selectValue(dataItem);
}
+ } else if (filtered && focusedItem) {
+ focusedItem.removeClass("k-state-selected");
}
- if (length) {
+ if (length && (page === undefined || page === 1)) {
if (options.highlightFirst) {
- that.listView.first();
+ if (!focusedItem && !listView.focusIndex()) {
+ listView.focus(0);
+ }
+ } else {
+ listView.focus(-1);
}
- if (options.suggest && isActive) {
+ if (options.suggest && isActive && that.input.val()) {
that.suggest(data[0]);
}
}
@@ -26444,26 +27908,27 @@ var A = 0;
if (that._open) {
that._open = false;
- if (that._typing && !isActive) {
+ if (that._typingTimeout && !isActive) {
that.popup.close();
} else {
that.toggle(!!length);
}
- that._typing = null;
+ that._typingTimeout = null;
}
if (that._touchScroller) {
that._touchScroller.reset();
}
+ that._hideBusy();
that.trigger("dataBound");
},
_listChange: function() {
this._selectValue(this.listView.selectedDataItems()[0]);
- if (this._old && this._oldIndex === -1) {
+ if (this._presetValue) {
this._oldIndex = this.selectedIndex;
}
},
@@ -26472,7 +27937,7 @@ var A = 0;
var data, found, idx;
if (typeof candidate === "function") {
- data = this.listView.data();
+ data = this.dataSource.flatView();
for (idx = 0; idx < data.length; idx++) {
if (candidate(data[idx])) {
@@ -26498,13 +27963,12 @@ var A = 0;
this._accessor("");
}
+ this.listView.select(candidate);
+
if (!keepState && this._state === STATE_FILTER) {
this.listView.filter(false);
- this.listView.clearIndices();
this._state = STATE_ACCEPT;
}
-
- this.listView.select(candidate);
},
_selectValue: function(dataItem) {
@@ -26572,6 +28036,7 @@ var A = 0;
}
if (word) {
+ word = word.toString();
idx = word.toLowerCase().indexOf(value.toLowerCase());
if (idx > -1) {
value += word.substring(idx + value.length);
@@ -26598,48 +28063,52 @@ var A = 0;
var dataItem;
var value;
- if (text !== undefined) {
- dataItem = that.dataItem();
+ if (text === undefined) {
+ return input.value;
+ }
- if (dataItem && that._text(dataItem) === text) {
- value = that._value(dataItem);
- if (value === null) {
- value = "";
- } else {
- value += "";
- }
+ dataItem = that.dataItem();
- if (value === that._old) {
- that._triggerCascade();
- return;
- }
+ if (that.options.autoBind === false && !that.listView.isBound()) {
+ return;
+ }
+
+ if (dataItem && that._text(dataItem) === text) {
+ value = that._value(dataItem);
+ if (value === null) {
+ value = "";
+ } else {
+ value += "";
}
- if (ignoreCase) {
- loweredText = loweredText.toLowerCase();
+ if (value === that._old) {
+ that._triggerCascade();
+ return;
}
+ }
- that._select(function(data) {
- data = that._text(data);
+ if (ignoreCase) {
+ loweredText = loweredText.toLowerCase();
+ }
- if (ignoreCase) {
- data = (data + "").toLowerCase();
- }
+ that._select(function(data) {
+ data = that._text(data);
- return data === loweredText;
- });
+ if (ignoreCase) {
+ data = (data + "").toLowerCase();
+ }
- if (that.selectedIndex < 0) {
- that._accessor(text);
- input.value = text;
+ return data === loweredText;
+ });
- that._triggerCascade();
- }
+ if (that.selectedIndex < 0) {
+ that._accessor(text);
+ input.value = text;
- that._prev = input.value;
- } else {
- return input.value;
+ that._triggerCascade();
}
+
+ that._prev = input.value;
},
toggle: function(toggle) {
@@ -26649,39 +28118,38 @@ var A = 0;
value: function(value) {
var that = this;
var options = that.options;
- var index;
if (value === undefined) {
value = that._accessor() || that.listView.value()[0];
return value === undefined || value === null ? "" : value;
}
- if (value === null) {
- value = "";
- }
-
- value = value.toString();
-
if (value === options.value && that.input.val() === options.text) {
return;
}
- that.input.val(value);
that._accessor(value);
- that.listView.value(value);
- that._triggerCascade();
+ that.listView
+ .value(value)
+ .done(function() {
+ that._selectValue(that.listView.selectedDataItems()[0]);
- index = that.listView.select()[0];
- if (index === undefined) {
- index = -1;
- }
+ if (that.selectedIndex === -1) {
+ that._accessor(value);
+ that.input.val(value);
+ that._placeholder(true);
+ }
- that._old = that._accessor();
- that._oldIndex = that.selectedIndex = index;
+ that._old = that._accessor();
+ that._oldIndex = that.selectedIndex;
- that._prev = that.input.val();
- that._state = STATE_ACCEPT;
+ that._prev = that.input.val();
+
+ if (that._state === STATE_FILTER) {
+ that._state = STATE_ACCEPT;
+ }
+ });
that._fetchData();
},
@@ -26740,17 +28208,15 @@ var A = 0;
if (current) {
if (options.suggest) {
- this.suggest(current);
+ that.suggest(current);
}
this.open();
}
if (this.options.highlightFirst && !word) {
- this.listView.first();
+ this.listView.focusFirst();
}
-
- that._hideBusy();
},
_input: function() {
@@ -26776,6 +28242,7 @@ var A = 0;
}
input[0].style.cssText = element.style.cssText;
+ input[0].title = element.title;
if (element.maxLength > -1) {
input[0].maxLength = element.maxLength;
@@ -26821,8 +28288,8 @@ var A = 0;
that._last = key;
- clearTimeout(that._typing);
- that._typing = null;
+ clearTimeout(that._typingTimeout);
+ that._typingTimeout = null;
if (key != keys.TAB && !that._move(e)) {
that._search();
@@ -26867,7 +28334,7 @@ var A = 0;
_search: function() {
var that = this;
- that._typing = setTimeout(function() {
+ that._typingTimeout = setTimeout(function() {
var value = that.text();
if (that._prev !== value) {
@@ -26875,7 +28342,7 @@ var A = 0;
that.search(value);
}
- that._typing = null;
+ that._typingTimeout = null;
}, that.options.delay);
},
@@ -26900,9 +28367,23 @@ var A = 0;
var custom = hasValue && parent.selectedIndex === -1;
if (isFiltered || !hasValue || custom) {
- that.value("");
that.options.value = "";
+ that.value("");
}
+ },
+
+ _preselect: function(value, text) {
+ this.input.val(text);
+ this._accessor(value);
+
+ this._old = this._accessor();
+ this._oldIndex = this.selectedIndex;
+
+ this.listView.setValue(value);
+ this._placeholder();
+
+ this._initialIndex = null;
+ this._presetValue = true;
}
});
@@ -26931,9 +28412,6 @@ var A = 0;
CHANGE = "change",
PROGRESS = "progress",
SELECT = "select",
- NEXT = "nextSibling",
- PREV = "previousSibling",
- HIDE = ' style="display:none"',
ARIA_DISABLED = "aria-disabled",
ARIA_READONLY = "aria-readonly",
FOCUSEDCLASS = "k-state-focused",
@@ -26961,7 +28439,7 @@ var A = 0;
var MultiSelect = List.extend({
init: function(element, options) {
- var that = this, id, data;
+ var that = this, id, disabled;
that.ns = ns;
List.fn.init.call(that, element, options);
@@ -26979,7 +28457,6 @@ var A = 0;
element = that.element.attr("multiple", "multiple").hide();
options = that.options;
- data = options.value;
if (!options.placeholder) {
options.placeholder = element.data("placeholder");
@@ -27008,23 +28485,36 @@ var A = 0;
if (options.autoBind) {
that.dataSource.fetch();
- } else if (data) { //TODO: work with VirtualList
- if (!isArray(data)) {
- data = [data];
- }
+ } else if (options.value) {
+ that._preselect(options.value);
+ }
- if ($.isPlainObject(data[0]) || !options.dataValueField) {
- that._retrieveData = true;
- that.dataSource.data(data);
- that.value(that._initialValues);
- }
+ disabled = $(that.element).parents("fieldset").is(':disabled');
+
+ if (disabled) {
+ that.enable(false);
}
kendo.notify(that);
},
+ _preselect: function(data, value) {
+ var that = this;
+
+ if (!isArray(data) && !(data instanceof kendo.data.ObservableArray)) {
+ data = [data];
+ }
+
+ if ($.isPlainObject(data[0]) || data[0] instanceof kendo.data.ObservableObject || !that.options.dataValueField) {
+ that.dataSource.data(data);
+ that.value(value || that._initialValues);
+ that._retrieveData = true;
+ }
+ },
+
options: {
name: "MultiSelect",
+ tagMode: "multiple",
enabled: true,
autoBind: true,
autoClose: true,
@@ -27037,11 +28527,13 @@ var A = 0;
delay: 100,
value: null,
maxSelectedItems: null,
- itemTemplate: "",
- tagTemplate: "",
placeholder: "",
height: 200,
- animation: {}
+ animation: {},
+ itemTemplate: "",
+ tagTemplate: "",
+ groupTemplate: "#:data#",
+ fixedGroupTemplate: "#:data#"
},
events: [
@@ -27054,7 +28546,6 @@ var A = 0;
"dataBound"
],
- //TODO: Consolidate with ui.Select
setDataSource: function(dataSource) {
this.options.dataSource = dataSource;
@@ -27068,9 +28559,13 @@ var A = 0;
},
setOptions: function(options) {
+ var listOptions = this._listOptions(options);
+
List.fn.setOptions.call(this, options);
- this.listView.setOptions(options);
+ this._normalizeOptions(listOptions);
+
+ this.listView.setOptions(listOptions);
this._accessors();
this._aria(this.tagList.attr(ID));
@@ -27111,7 +28606,7 @@ var A = 0;
ns = that.ns;
clearTimeout(that._busy);
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
that.wrapper.off(ns);
that.tagList.off(ns);
@@ -27120,54 +28615,59 @@ var A = 0;
List.fn.destroy.call(that);
},
+ _activateItem: function() {
+ List.fn._activateItem.call(this);
+ this.currentTag(null);
+ },
+
+ _normalizeOptions: function(options) {
+ var itemTemplate = this.options.itemTemplate || this.options.template;
+ var template = options.itemTemplate || itemTemplate || options.template;
+
+ if (!template) {
+ template = "#:" + kendo.expr(options.dataTextField, "data") + "#";
+ }
+
+ options.template = template;
+ },
+
_initList: function() {
var that = this;
- var options = this.options;
- var template = options.template || options.itemTemplate || "#:" + kendo.expr(options.dataTextField, "data") + "#";
+ var virtual = that.options.virtual;
+ var hasVirtual = !!virtual;
+
+ var listBoundHandler = proxy(that._listBound, that);
var listOptions = {
autoBind: false,
selectable: "multiple",
- height: options.height,
- dataSource: this.dataSource,
- dataValueField: options.dataValueField,
- groupTemplate: options.groupTemplate || "#:data#",
- fixedGroupTemplate: options.fixedGroupTemplate || "#:data#",
- template: template,
- activate: function() {
- var current = this.focus();
- if (current) {
- that._focused.add(that.filterInput).attr("aria-activedescendant", current.attr("id"));
- }
-
- that.currentTag(null);
- },
- click: $.proxy(this._click, this),
- change: $.proxy(this._listChange, this),
- deactivate: function() {
- that._focused.add(that.filterInput).removeAttr("aria-activedescendant");
- },
+ dataSource: that.dataSource,
+ click: proxy(that._click, that),
+ change: proxy(that._listChange, that),
+ activate: proxy(that._activateItem, that),
+ deactivate: proxy(that._deactivateItem, that),
dataBinding: function() {
- that.trigger("dataBinding"); //TODO: make preventable
+ that.trigger("dataBinding");
that._angularItems("cleanup");
},
- listBound: $.proxy(this._listBound, this),
- dataBound: $.proxy(this._listBound, this)
+ dataBound: listBoundHandler,
+ listBound: listBoundHandler,
+ selectedItemChange: proxy(that._selectedItemChange, that)
};
- if (options.virtual) {
- if (typeof options.virtual === "object") {
- $.extend(listOptions, {
- listBound: $.proxy(this._listBound, this)
- }, options.virtual);
- }
+ listOptions = $.extend(that._listOptions(), listOptions, typeof virtual === "object" ? virtual : {});
+
+ that._normalizeOptions(listOptions);
- this.listView = new kendo.ui.VirtualList(this.ul, listOptions);
+ if (!hasVirtual) {
+ that.listView = new kendo.ui.StaticList(that.ul, listOptions);
} else {
- this.listView = new kendo.ui.StaticList(this.ul, listOptions);
+ that.listView = new kendo.ui.VirtualList(that.ul, listOptions);
}
- this.listView.value(this._initialValues || this.options.value);
+ that.listView.bind("click", function(e) { e.preventDefault(); });
+
+ that.listView.value(that._initialValues || that.options.value);
},
_listChange: function(e) {
@@ -27179,15 +28679,32 @@ var A = 0;
this._selectValue(e.added, e.removed);
},
+ _selectedItemChange: function(e) {
+ var items = e.items;
+ var context;
+ var idx;
+
+ for (idx = 0; idx < items.length; idx++) {
+ context = items[idx];
+ this.tagList.children().eq(context.index).children("span:first").html(this.tagTextTemplate(context.item));
+ }
+ },
+
_wrapperMousedown: function(e) {
var that = this;
var notInput = e.target.nodeName.toLowerCase() !== "input";
+ var target = $(e.target);
+ var closeButton = target.hasClass("k-select") || target.hasClass("k-icon");
+
+ if (closeButton) {
+ closeButton = !target.closest(".k-select").children(".k-i-arrow-s").length;
+ }
- if (notInput) {
+ if (notInput && !(closeButton && kendo.support.mobileOS)) {
e.preventDefault();
}
- if (e.target.className.indexOf("k-delete") === -1) {
+ if (!closeButton) {
if (that.input[0] !== activeElement() && notInput) {
that.input.focus();
}
@@ -27207,7 +28724,7 @@ var A = 0;
_inputFocusout: function() {
var that = this;
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
that.wrapper.removeClass(FOCUSEDCLASS);
@@ -27217,6 +28734,7 @@ var A = 0;
if (that._state === FILTER) {
that._state = ACCEPT;
that.listView.filter(false);
+ that.listView.skipUpdate(true);
}
that.element.blur();
@@ -27224,20 +28742,24 @@ var A = 0;
_removeTag: function(tag) {
var that = this;
+ var state = that._state;
var position = tag.index();
var listView = that.listView;
- var value = listView.value();
-
- var customIndex = that._customOptions[value[position]];
+ var value = listView.value()[position];
+ var customIndex = that._customOptions[value];
var option;
- if (customIndex !== undefined) {
- value.splice(position, 1);
- listView.value(value, true);
+ if (customIndex === undefined && (state === ACCEPT || state === FILTER)) {
+ customIndex = that._optionsMap[value];
+ }
+ if (customIndex !== undefined) {
option = that.element[0].children[customIndex];
option.removeAttribute("selected");
option.selected = false;
+
+ listView.removeAt(position);
+ tag.remove();
} else {
listView.select(listView.select()[position]);
}
@@ -27248,7 +28770,11 @@ var A = 0;
},
_tagListClick: function(e) {
- this._removeTag($(e.target).closest(LI));
+ var target = $(e.currentTarget);
+
+ if (!target.children(".k-i-arrow-s").length) {
+ this._removeTag(target.closest(LI));
+ }
},
_editable: function(options) {
@@ -27278,7 +28804,7 @@ var A = 0;
tagList
.on(MOUSEENTER, LI, function() { $(this).addClass(HOVERCLASS); })
.on(MOUSELEAVE, LI, function() { $(this).removeClass(HOVERCLASS); })
- .on(CLICK, ".k-delete", proxy(that._tagListClick, that));
+ .on(CLICK, "li.k-button .k-select", proxy(that._tagListClick, that));
} else {
if (disable) {
wrapper.addClass(STATEDISABLED);
@@ -27298,7 +28824,7 @@ var A = 0;
if (that.options.autoClose) {
that.close();
} else {
- that.popup._position();
+ that.popup.position();
}
},
@@ -27313,12 +28839,14 @@ var A = 0;
that._retrieveData = false;
}
- if (that._retrieveData || !this.listView.isBound() || that._state === ACCEPT) {
- that.listView.filter(false);
-
+ if (that._retrieveData || !that.listView.isBound() || that._state === ACCEPT) {
that._open = true;
that._state = REBIND;
that._retrieveData = false;
+
+ that.listView.filter(false);
+ that.listView.skipUpdate(true);
+
that._filterSource();
} else if (that._allowSelection()) {
that.popup.open();
@@ -27338,7 +28866,8 @@ var A = 0;
_listBound: function() {
var that = this;
- var data = this.listView.data();
+ var data = that.dataSource.flatView();
+ var page = that.dataSource.page();
var length = data.length;
that._angularItems("compile");
@@ -27352,21 +28881,19 @@ var A = 0;
that.toggle(length);
}
- if (that.popup.visible()) {
- that.popup._position();
- }
+ that.popup.position();
- if (that.options.highlightFirst) {
- that.listView.first();
+ if (that.options.highlightFirst && (page === undefined || page === 1)) {
+ that.listView.focusFirst();
}
if (that._touchScroller) {
that._touchScroller.reset();
}
+ that._hideBusy();
that._makeUnselectable();
- that._hideBusy();
that.trigger("dataBound");
},
@@ -27384,7 +28911,7 @@ var A = 0;
inputValue = "";
}
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
word = typeof word === "string" ? word : inputValue;
@@ -27411,7 +28938,6 @@ var A = 0;
var that = this;
var oldValue = that.listView.value().slice();
var maxSelectedItems = that.options.maxSelectedItems;
- var idx;
if (value === undefined) {
return oldValue;
@@ -27423,14 +28949,6 @@ var A = 0;
value = value.slice(0, maxSelectedItems);
}
- if (value.length && oldValue.length) {
- for (idx = 0; idx < oldValue.length; idx++) {
- that._setOption(oldValue[idx], false);
- }
-
- that.tagList.html("");
- }
-
that.listView.value(value);
that._old = value;
@@ -27457,13 +28975,14 @@ var A = 0;
var hasItems = !!that.dataSource.view().length;
var isEmptyArray = that.listView.value().length === 0;
- if (isEmptyArray) {
+ if (isEmptyArray || that._request) {
return;
}
- if (!that._fetch && !hasItems) {
+ if (that._retrieveData || (!that._fetch && !hasItems)) {
that._fetch = true;
- that.dataSource.fetch().done(function() {
+ that._retrieveData = false;
+ that.dataSource.read().done(function() {
that._fetch = false;
});
}
@@ -27574,23 +29093,23 @@ var A = 0;
that.open();
if (!current) {
- this.listView.first();
+ this.listView.focusFirst();
}
return;
}
if (current) {
- this.listView.next();
+ this.listView.focusNext();
if (!this.listView.focus()) {
- this.listView.last();
+ this.listView.focusLast();
}
} else {
- this.listView.first();
+ this.listView.focusFirst();
}
} else if (key === keys.UP) {
if (visible) {
if (current) {
- this.listView.prev();
+ this.listView.focusPrev();
}
if (!this.listView.focus()) {
@@ -27633,7 +29152,7 @@ var A = 0;
that.close();
} else if (key === keys.HOME) {
if (visible) {
- this.listView.first();
+ this.listView.focusFirst();
} else if (!hasValue) {
tag = that.tagList[0].firstChild;
@@ -27643,7 +29162,7 @@ var A = 0;
}
} else if (key === keys.END) {
if (visible) {
- this.listView.last();
+ this.listView.focusLast();
} else if (!hasValue) {
tag = that.tagList[0].lastChild;
@@ -27660,7 +29179,7 @@ var A = 0;
that._removeTag(tag);
}
} else {
- clearTimeout(that._typing);
+ clearTimeout(that._typingTimeout);
setTimeout(function() { that._scale(); });
that._search();
}
@@ -27733,10 +29252,8 @@ var A = 0;
that.input.width(textWidth > wrapperWidth ? wrapperWidth : textWidth);
},
- _option: function(dataItem, selected) {
- var option = "