Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Markdown cells now default in edit mode
fixes #1250
- Loading branch information
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,15 +88,18 @@ | |
if (bkHelper.isNotebookLocked()) return; | ||
|
||
scope.mode = 'edit'; | ||
var clickLocation; | ||
var markdownCell = element.find('.markdown-wrapper'); | ||
var top = markdownCell.offset().top; | ||
var bottom = top + markdownCell.outerHeight(); | ||
|
||
if (event.pageY < (top + bottom) / 2) { | ||
clickLocation = 'top'; | ||
} else { | ||
clickLocation = 'bottom'; | ||
|
||
if (event){ | ||
var clickLocation; | ||
var markdownCell = element.find('.markdown-wrapper'); | ||
var top = markdownCell.offset().top; | ||
var bottom = top + markdownCell.outerHeight(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
scottdraves
Contributor
|
||
|
||
if (event.pageY < (top + bottom) / 2) { | ||
clickLocation = 'top'; | ||
} else { | ||
clickLocation = 'bottom'; | ||
} | ||
} | ||
|
||
var markdown = element.find('.markdown'); | ||
|
@@ -110,7 +113,7 @@ | |
}); | ||
}; | ||
|
||
preview(); | ||
scope.edit(); | ||
|
||
element.find('.markdown').on('blur', function() { | ||
scope.$apply(function() { | ||
|
It is good to be aware of what causes reflows on the page (this is a line that does), reflows can be expensive as far as the cost to perf in the browser. Every-time we access these properties there is a significant cost. In large applications this can start having a cascading effect causing paints and perf to crawl to a halt
check out this great issue from @paulirish on perf on wikipedia because of the "hidden" cost of jquery's show method
jquery/jquery.com#88 (comment)