Skip to content

Commit

Permalink
remove some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
gpoitch committed Sep 14, 2014
1 parent f4b6850 commit a9f7f02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 40 deletions.
37 changes: 2 additions & 35 deletions src/js/content-kit-editor/utils/selection-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,7 @@ function selectionIsInElement(selection, element) {

function selectionIsEditable(selection) {
var el = getSelectionBlockElement(selection);
return el.isContentEditable;
}

/*
function saveSelection() {
var sel = window.getSelection();
var ranges = [], i;
if (sel.rangeCount) {
var rangeCount = sel.rangeCount;
for (i = 0; i < rangeCount; i++) {
ranges.push(sel.getRangeAt(i));
}
}
return ranges;
}
function restoreSelection(savedSelection) {
var sel = window.getSelection();
var len = savedSelection.length, i;
sel.removeAllRanges();
for (i = 0; i < len; i++) {
sel.addRange(savedSelection[i]);
}
}
*/

function moveCursorToBeginningOfSelection(selection) {
var range = document.createRange();
var node = selection.anchorNode;
range.setStart(node, 0);
range.setEnd(node, 0);
selection.removeAllRanges();
selection.addRange(range);
return el && el.isContentEditable;
}

function restoreRange(range) {
Expand All @@ -129,5 +97,4 @@ function selectNode(node) {
}

export { getDirectionOfSelection, getSelectionElement, getSelectionBlockElement, getSelectionTagName,
getSelectionBlockTagName, tagsInSelection, selectionIsInElement, selectionIsEditable,
moveCursorToBeginningOfSelection, restoreRange, selectNode };
getSelectionBlockTagName, tagsInSelection, selectionIsInElement, selectionIsEditable, restoreRange, selectNode };
5 changes: 0 additions & 5 deletions src/js/content-kit-editor/views/toolbar-button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Command from '../commands/base';

var buttonClassName = 'ck-toolbar-btn';

Expand All @@ -9,10 +8,6 @@ function ToolbarButton(options) {
var prompt = command.prompt;
var element = document.createElement('button');

if(typeof command === 'string') {
command = Command.index[command];
}

button.element = element;
button.command = command;
button.isActive = false;
Expand Down

0 comments on commit a9f7f02

Please sign in to comment.