Permalink
Browse files

refactor: converting class name to correct BEM format: making it a mo…

…difier (vs a block)
  • Loading branch information...
Steven Dale
Steven Dale committed Aug 24, 2015
1 parent dee5b0d commit a9a9964e4094604c4d9a8294ad905cb66d37c727
@@ -12,12 +12,12 @@ BitEvents = {
// SD: OQ/TODO: this fails on bit:delete, how can we reuse this function?
var $bitElement = $(template.firstNode);
$bitElement.find('.bit__editing').focus();
$bitElement.find('.bit--editing').focus();
$bitElement.addClass('hovering');
$bitElement.find('.bit__resize').show();
$bitElement.find('.bit__controls-persistent').show();
var $editingElement = $bitElement.find('.bit__editing');
var $editingElement = $bitElement.find('.bit--editing');
$editingElement.attr('contenteditable', 'true');
$editingElement.attr('data-clickable', 'true');
}
@@ -32,7 +32,7 @@ BitEvents = {
$bitElement.find('.bit__resize').hide();
$bitElement.find('.bit__controls-persistent').hide();
var $editingElement = $(template.find('.bit__editing'));
var $editingElement = $(template.find('.bit--editing'));
$editingElement.attr('contenteditable', 'false');
$editingElement.attr('data-clickable', 'false');
@@ -32,6 +32,6 @@ Template.bit.helpers({
// https://github.com/meteor/meteor/issues/3635
// possible alternative workaround: https://github.com/eluck/contenteditable/commit/b406d83863341c376f21f7de5056fdc8d4100877
editor: function () {
return '<div class="bit__editing" contenteditable="false">' + this.content + '</div>';
return '<div class="bit--editing" contenteditable="false">' + this.content + '</div>';
}
});
@@ -5,7 +5,7 @@ Template.bit.onRendered(function (){
var bitDatabaseId = bit._id;
var $bitElement = $(template.firstNode);
var $content = $bitElement.find('.bit__content');
var $editbitElement = $content.find('.bit__editing');
var $editbitElement = $content.find('.bit--editing');
$content.css("height", bit.height);
$content.css("width", bit.width);
@@ -126,7 +126,7 @@
}
.bit__editing {
.bit--editing {
outline: none;
border: 0;
width: 100%;
@@ -10,10 +10,10 @@ module.exports = function () {
return self.browser.executeScript("var e = jQuery.Event( 'dblclick', { offsetX: 100, offsetY: 100 } ); $('.map').trigger(e);");
}).
then(function () {
return self.browser.findElement(self.webdriver.By.className("bit__editing")).sendKeys(content);
return self.browser.findElement(self.webdriver.By.className("bit--editing")).sendKeys(content);
}).
then(function () {
return self.browser.findElement(self.webdriver.By.className("bit__editing")).sendKeys(self.webdriver.Key.RETURN);
return self.browser.findElement(self.webdriver.By.className("bit--editing")).sendKeys(self.webdriver.Key.RETURN);
}).
then(callback).
then(null, function(err) {

0 comments on commit a9a9964

Please sign in to comment.