Skip to content

Commit

Permalink
Refactoring appendTo instead of append.
Browse files Browse the repository at this point in the history
  • Loading branch information
hackerwins committed Sep 29, 2015
1 parent ae04568 commit 51893f5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 21 deletions.
4 changes: 1 addition & 3 deletions src/js/bs3/module/HelpDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ define([
this.$dialog = ui.dialog({
title: lang.options.help,
body: body
}).render();

$container.append(this.$dialog);
}).render().appendTo($container);
};

/**
Expand Down
4 changes: 1 addition & 3 deletions src/js/bs3/module/ImageDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ define([
title: lang.image.insert,
body: body,
footer: footer
}).render();

$container.append(this.$dialog);
}).render().appendTo($container);
};

this.bindEnterKey = function ($input, $btn) {
Expand Down
4 changes: 1 addition & 3 deletions src/js/bs3/module/ImagePopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ define([

var $popover = ui.popover({
className: 'note-image-popover'
}).render();

$editingArea.append($popover);
}).render().appendTo($popover);

this.initialize = function () {
summernote.buildButtons($popover.find('.popover-content'), options.popover.image);
Expand Down
6 changes: 2 additions & 4 deletions src/js/bs3/module/LinkDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ define([
);
var footer = '<button href="#" class="btn btn-primary note-link-btn disabled" disabled>' + lang.link.insert + '</button>';

$container.append(ui.dialog({
this.$dialog = ui.dialog({
className: 'link-dialog',
title: lang.link.insert,
body: body,
footer: footer
}).render());

this.$dialog = $container.find('.link-dialog');
}).render().appendTo($container);
};

this.bindEnterKey = function ($input, $btn) {
Expand Down
4 changes: 1 addition & 3 deletions src/js/bs3/module/LinkPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ define([

var $popover = ui.popover({
className: 'note-link-popover'
}).render();

$editingArea.append($popover);
}).render().appendTo($editingArea);;

this.initialize = function () {
summernote.buildButtons($popover.find('.popover-content'), options.popover.link);
Expand Down
6 changes: 2 additions & 4 deletions src/js/lite/module/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(function () {
var $toolbar = summernote.layoutInfo.toolbar;

this.initialize = function () {
var $btnGroup = ui.buttonGroup([
ui.buttonGroup([
ui.button({
contents: 'bold',
click: summernote.createInvokeHandler('editor.bold')
Expand All @@ -13,9 +13,7 @@ define(function () {
contents: 'italic',
click: summernote.createInvokeHandler('editor.italic')
})
]).render();

$toolbar.append($btnGroup);
]).render().appendTo($toolbar);
};

this.destroy = function () {
Expand Down
2 changes: 1 addition & 1 deletion src/js/summernote.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ define([
$group.append(typeof button === 'function' ? button(this) : button);
}
}
$container.append($group);
$group.appendTo($container);
}
};

Expand Down

0 comments on commit 51893f5

Please sign in to comment.