|
|
@ -61,7 +61,7 @@ module.exports = function() { |
|
|
|
var title = scope.isPreview ? PREVIEW_DISABLE_TEXT : PREVIEW_ENABLE_TEXT; |
|
|
|
var title = scope.isPreview ? PREVIEW_DISABLE_TEXT : PREVIEW_ENABLE_TEXT; |
|
|
|
var toggledClasses = 'icon-preview icon-ticket-edit -active'; |
|
|
|
var toggledClasses = 'icon-preview icon-ticket-edit -active'; |
|
|
|
|
|
|
|
|
|
|
|
element.closest('.wp-edit-field') |
|
|
|
element.closest('.textarea-wrapper') |
|
|
|
.find('.' + PREVIEW_BUTTON_CLASS).attr('title', title) |
|
|
|
.find('.' + PREVIEW_BUTTON_CLASS).attr('title', title) |
|
|
|
.attr('aria-label', title) |
|
|
|
.attr('aria-label', title) |
|
|
|
.toggleClass(toggledClasses); |
|
|
|
.toggleClass(toggledClasses); |
|
|
@ -69,7 +69,7 @@ module.exports = function() { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
element |
|
|
|
element |
|
|
|
.closest('.wp-edit-field') |
|
|
|
.closest('.textarea-wrapper') |
|
|
|
.find('.jstb_help') |
|
|
|
.find('.jstb_help') |
|
|
|
.after(jQuery('<button>', previewButtonAttributes)); |
|
|
|
.after(jQuery('<button>', previewButtonAttributes)); |
|
|
|
// changes are made by jQuery, we trigger input event so that
|
|
|
|
// changes are made by jQuery, we trigger input event so that
|
|
|
@ -84,7 +84,7 @@ module.exports = function() { |
|
|
|
transclude: false, |
|
|
|
transclude: false, |
|
|
|
link: link, |
|
|
|
link: link, |
|
|
|
scope: { |
|
|
|
scope: { |
|
|
|
previewToggle: '=' |
|
|
|
previewToggle: '&' |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|
}; |
|
|
|