Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
fix #146 - hide buttons on embeds placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
linkesch committed Feb 17, 2015
1 parent 2b59aa7 commit a936444
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
3 changes: 2 additions & 1 deletion dist/css/medium-editor-insert-plugin.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@
.medium-insert-embeds-input {
position: relative;
color: #ccc;
z-index: 1; }
z-index: 1;
text-align: left; }

.medium-insert-embeds-placeholder {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion dist/css/medium-editor-insert-plugin.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions dist/js/medium-editor-insert-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,10 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
$.each(this.options.addons, function (addon) {
if ($el.closest('.medium-insert-'+ addon).length) {
$current = $el;
$p = $el.closest('.medium-insert-'+ addon);
}

if ($current.closest('.medium-insert-'+ addon).length) {
$p = $current.closest('.medium-insert-'+ addon);
isAddon = true;
return;
}
Expand Down Expand Up @@ -723,11 +726,12 @@ this["MediumInsert"]["Templates"]["src/js/templates/images-toolbar.hbs"] = Handl
this.getCore().moveCaret($place);
}

$place.addClass('medium-insert-embeds-input medium-insert-embeds-active');
$place.addClass('medium-insert-embeds medium-insert-embeds-input medium-insert-embeds-active');

this.togglePlaceholder({ target: $place.get(0) });

$place.click();
this.getCore().hideButtons();
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/js/medium-editor-insert-plugin.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@
$.each(this.options.addons, function (addon) {
if ($el.closest('.medium-insert-'+ addon).length) {
$current = $el;
$p = $el.closest('.medium-insert-'+ addon);
}

if ($current.closest('.medium-insert-'+ addon).length) {
$p = $current.closest('.medium-insert-'+ addon);
isAddon = true;
return;
}
Expand Down
3 changes: 2 additions & 1 deletion src/js/embeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@
this.getCore().moveCaret($place);
}

$place.addClass('medium-insert-embeds-input medium-insert-embeds-active');
$place.addClass('medium-insert-embeds medium-insert-embeds-input medium-insert-embeds-active');

this.togglePlaceholder({ target: $place.get(0) });

$place.click();
this.getCore().hideButtons();
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/sass/_embeds.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
position: relative;
color: #ccc;
z-index: 1;
text-align: left;
}

.medium-insert-embeds-placeholder {
Expand Down

0 comments on commit a936444

Please sign in to comment.