From 4307aba2098aebd9b41d704cec9d7fdd4c82806c Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 6 Dec 2013 23:08:34 +0400 Subject: [PATCH] fix #1693 searchbox is broken when creating ace in pre tag --- demo/kitchen-sink/dev_util.js | 20 ++++++++++++-------- lib/ace/ext/searchbox.css | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/demo/kitchen-sink/dev_util.js b/demo/kitchen-sink/dev_util.js index dfe3d942..81ab446b 100644 --- a/demo/kitchen-sink/dev_util.js +++ b/demo/kitchen-sink/dev_util.js @@ -40,14 +40,18 @@ function warn() { } } function def(o, key, get) { - Object.defineProperty(o, key, { - configurable: true, - get: get, - set: function(val) { - delete o[key]; - o[key] = val; - } - }); + try { + Object.defineProperty(o, key, { + configurable: true, + get: get, + set: function(val) { + delete o[key]; + o[key] = val; + } + }); + } catch(e) { + console.error(e); + } } def(window, "ace", function(){ warn(); return window.env.editor }); def(window, "editor", function(){ warn(); return window.env.editor }); diff --git a/lib/ace/ext/searchbox.css b/lib/ace/ext/searchbox.css index c0f5f284..98b54257 100644 --- a/lib/ace/ext/searchbox.css +++ b/lib/ace/ext/searchbox.css @@ -16,6 +16,7 @@ position: absolute; top: 0px; z-index: 99; + white-space: normal; } .ace_search.left { border-left: 0 none;