From 0e58f3f11f60a3cd1fbe969ed6a49fdd9ad4b9a5 Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Mon, 28 Dec 2020 15:15:45 +0530 Subject: [PATCH 1/2] #tool_imagelib image library menu missing in main menu --- .../extensions/ext-imagelib/ext-imagelib.js | 28 +++++++------------ src/editor/images/library.svg | 10 +++++++ src/editor/index.html | 1 + 3 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 src/editor/images/library.svg diff --git a/src/editor/extensions/ext-imagelib/ext-imagelib.js b/src/editor/extensions/ext-imagelib/ext-imagelib.js index 87c38b46..0d438cd6 100644 --- a/src/editor/extensions/ext-imagelib/ext-imagelib.js +++ b/src/editor/extensions/ext-imagelib/ext-imagelib.js @@ -372,7 +372,7 @@ export default { let browser = $('#imgbrowse'); if (!browser.length) { $('
' + - '
').insertAfter('#svg_docprops'); + '').insertAfter('#svg_editor'); browser = $('#imgbrowse'); const allLibs = imagelibStrings.select_lib; @@ -386,8 +386,8 @@ export default { left: 0, width: '100%' }); - - const cancel = $('') + // eslint-disable-next-line max-len + const cancel = $('') .appendTo(browser) .on('click touchend', function () { $('#imgbrowse_holder').hide(); @@ -398,8 +398,8 @@ export default { }); const leftBlock = $('').css({position: 'absolute', top: 5, left: 10}).appendTo(browser); - - const back = $('') + // eslint-disable-next-line max-len + const back = $('') .appendTo(leftBlock) .on('click touchend', function () { frame.attr('src', 'about:blank').hide(); @@ -430,9 +430,6 @@ export default { 'margin-top': 10 }); - cancel.prepend($.getSvgIcon('cancel', true)); - back.prepend($.getSvgIcon('tool_imagelib', true)); - imagelibStrings.imgLibs.forEach(function ({name, url, description}) { $('
  • ') .appendTo(libOpts) @@ -452,21 +449,16 @@ export default { } } - const buttons = [{ + const events = { id: 'tool_imagelib', - type: 'app_menu', - icon: 'imagelib.png', - position: 4, - events: { - mouseup: showBrowser + click () { + showBrowser(); } - }]; + }; return { svgicons: 'ext-imagelib.xml', - buttons: imagelibStrings.buttons.map((button, i) => { - return Object.assign(buttons[i], button); - }), + events, callback () { $('