Skip to content

Commit

Permalink
Merge pull request #1112 from yabwe/anchor-preview-fix
Browse files Browse the repository at this point in the history
Fix #1105 - Fix bug with anchor-preview when clicked
  • Loading branch information
Rishi committed Jun 2, 2016
2 parents 3475cea + a0c3e1c commit bab8a7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion spec/anchor-preview.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ describe('Anchor Preview TestCase', function () {
expect(toolbar.isDisplayed()).toBe(true);
expect(anchor.isDisplayed()).toBe(true);

// textbox should contain the url
expect(anchor.getInput().value).toEqual('http://test.com');

// the checkboxes should be unchecked
expect(anchor.getAnchorTargetCheckbox().checked).toBe(false);
expect(anchor.getAnchorButtonCheckbox().checked).toBe(false);
Expand Down Expand Up @@ -306,7 +309,7 @@ describe('Anchor Preview TestCase', function () {
});

// https://github.com/yabwe/medium-editor/issues/1047
it('should display the anchor form in the toolbar when clicked when showWhenToolbarIsVisible is set to true adn toolbar is visible', function () {
it('should display the anchor form in the toolbar when clicked when showWhenToolbarIsVisible is set to true and toolbar is visible', function () {
var editor = this.newMediumEditor('.editor', {
anchorPreview: {
showWhenToolbarIsVisible: true
Expand Down
2 changes: 1 addition & 1 deletion src/js/extensions/anchor-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
this.base.delay(function () {
if (activeAnchor) {
var opts = {
url: activeAnchor.attributes.href.value,
value: activeAnchor.attributes.href.value,
target: activeAnchor.getAttribute('target'),
buttonClass: activeAnchor.getAttribute('class')
};
Expand Down

0 comments on commit bab8a7b

Please sign in to comment.