(opt, root, errorItem)
| 1542 | } |
| 1543 | |
| 1544 | function errorPromise(opt, root, errorItem) { |
| 1545 | // User called promise.reject() with an error item, if not, provide own error item. |
| 1546 | if (typeof errorItem === 'undefined') { |
| 1547 | errorItem = { |
| 1548 | "error": { |
| 1549 | name: "No items and no error item", |
| 1550 | icon: "context-menu-icon context-menu-icon-quit" |
| 1551 | } |
| 1552 | }; |
| 1553 | if (window.console) { |
| 1554 | (console.error || console.log).call(console, 'When you reject a promise, provide an "items" object, equal to normal sub-menu items'); |
| 1555 | } |
| 1556 | } else if (typeof errorItem === 'string') { |
| 1557 | errorItem = {"error": {name: errorItem}}; |
| 1558 | } |
| 1559 | finishPromiseProcess(opt, root, errorItem); |
| 1560 | } |
| 1561 | |
| 1562 | function finishPromiseProcess(opt, root, items) { |
| 1563 | if (typeof root.$menu === 'undefined' || !root.$menu.is(':visible')) { |
no test coverage detected