From 29983c16711b7eb6828afab8ca87a09eec9f6fe3 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 09 Oct 2010 12:46:53 -0400
Subject: [PATCH] - Add caching support in id2uid and uid2id functions (#1487019), Fix get_message_cache_index to use internal cache when only sort order changes. Both changes improves performance of 'show' action - code cleanup/function description fixes
---
program/js/tiny_mce/utils/editable_selects.js | 25 +++++++++++++++++--------
1 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/program/js/tiny_mce/utils/editable_selects.js b/program/js/tiny_mce/utils/editable_selects.js
index e723365..fd943c0 100644
--- a/program/js/tiny_mce/utils/editable_selects.js
+++ b/program/js/tiny_mce/utils/editable_selects.js
@@ -1,10 +1,11 @@
/**
- * $Id: editable_selects.js 162 2007-01-03 16:16:52Z spocke $
+ * editable_selects.js
*
- * Makes select boxes editable.
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
*
- * @author Moxiecode
- * @copyright Copyright � 2004-2007, Moxiecode Systems AB, All rights reserved.
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
*/
var TinyMCE_EditableSelects = {
@@ -20,13 +21,13 @@
o.className = 'mceAddSelectValue';
nl[i].options[nl[i].options.length] = o;
- nl[i].setAttribute('onchange', 'TinyMCE_EditableSelects.onChangeEditableSelect(this);');
+ nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
}
}
},
- onChangeEditableSelect : function(se) {
- var d = document, ne;
+ onChangeEditableSelect : function(e) {
+ var d = document, ne, se = window.event ? window.event.srcElement : e.target;
if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
ne = d.createElement("input");
@@ -34,11 +35,12 @@
ne.name = se.name + "_custom";
ne.type = "text";
- ne.style.width = se.clientWidth;
+ ne.style.width = se.offsetWidth + 'px';
se.parentNode.insertBefore(ne, se);
se.style.display = 'none';
ne.focus();
ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
+ ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
TinyMCE_EditableSelects.editSelectElm = se;
}
},
@@ -57,5 +59,12 @@
se.parentNode.removeChild(se.previousSibling);
TinyMCE_EditableSelects.editSelectElm = null;
}
+ },
+
+ onKeyDown : function(e) {
+ e = e || window.event;
+
+ if (e.keyCode == 13)
+ TinyMCE_EditableSelects.onBlurEditableSelectInput();
}
};
--
Gitblit v1.9.1