From e10d2fc56a169785d5454cda21094e1f66f4eee1 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Tue, 11 Jan 2011 11:16:54 +0000 Subject: [PATCH] dont fire open or preview events if no list item is selected --- build/js/ox.ui.js | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index dc72e71..edb7a57 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -6713,19 +6713,23 @@ requires } function open() { - that.triggerEvent('open', { - ids: getSelectedIds() + var ids = getSelectedIds(); + ids.length && that.triggerEvent('open', { + ids: ids }); } function preview() { - self.preview = !self.preview; - if (self.preview) { - that.triggerEvent('openpreview', { - ids: getSelectedIds() - }); - } else { - that.triggerEvent('closepreview'); + var ids = getSelectedIds(); + if (ids.length) { + self.preview = !self.preview; + if (self.preview) { + that.triggerEvent('openpreview', { + ids: getSelectedIds() + }); + } else { + that.triggerEvent('closepreview'); + } } } @@ -7178,6 +7182,7 @@ requires id: '', max: -1, min: 0, + pageLength: 100, selected: [], request: function() {}, // {sort, range, keys, callback} sort: [] @@ -7267,6 +7272,7 @@ requires }), max: self.options.max, min: self.options.min, + pageLength: self.options.pageLength, orientation: 'vertical', request: self.options.request, selected: self.options.selected, @@ -7525,7 +7531,8 @@ requires var $input, html = $cell.html(), index = getColumnIndexById(key), - width = self.options.columns[index].width; + column = self.options.columns[index], + width = column.width; Ox.print($item, $cell) $cell.empty() .addClass('OxEdit') @@ -7533,6 +7540,7 @@ requires width: width + 'px' }); $input = Ox.Input({ + autovalidate: column.input.autovalidate, style: 'square', value: html, width: width @@ -7545,13 +7553,12 @@ requires }) .bindEvent({ blur: submit, - submit: submit }) .appendTo($cell) .focus(); function submit() { var value = $input.value(); - $input.remove(); + //$input.loseFocus().remove(); $cell.removeClass('OxEdit') .css({ width: (width - 8) + 'px'