Skip to content

Commit

Permalink
safari iframe scrollbar hack
Browse files Browse the repository at this point in the history
  • Loading branch information
laoshu133 committed Sep 30, 2015
1 parent fd76e3d commit 70e22d2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,23 @@ _extend(KEdit, KWidget, {
if (bool === undefined ? !self.designMode : bool) {
if (!self.designMode) {
val = self.html();

self.designMode = true;
self.html(val);
self.textarea.hide();
self.iframe.show();

self.html(val);

// cache
var iframe = self.iframe;
var height = _removeUnit(self.height);

iframe.height(height - 2);
iframe.show();

// safari iframe scrollbar hack
setTimeout(function() {
iframe.height(height);
}, 0);
}
} else {
if (self.designMode) {
Expand Down

0 comments on commit 70e22d2

Please sign in to comment.