Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

Correct path plugins issue when reload wPaint #81

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/wPaint.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,11 +562,16 @@
// only add unique (new) items (icons)
if (!this.$menuHolder.children('.wPaint-menu-icon-name-' + key).length) {

// add the item name, we will need this internally
menu.items[key].name = key;

// use default img if img not set
menu.items[key].img = _this.wPaint.options.path + (menu.items[key].img || menu.img);
// add the item name, we will need this internally
menu.items[key].name = key;

// use default img if img not set
if(!menu.items[key].img) {
menu.items[key].img = _this.wPaint.options.path + menu.img;
} else if(menu.items[key].img.indexOf(_this.wPaint.options.path) !== 0) {
// if plugin path does not start by options.path add it
menu.items[key].img = _this.wPaint.options.path + menu.items[key].img;
}

// make self invoking to avoid overwrites
(itemAppend)(menu.items[key]);
Expand Down