This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/show-popup-button.js.es6

18 lines
458 B
JavaScript

import DButton from 'discourse/components/d-button';
export default DButton.extend({
click() {
const $target = this.$(),
position = $target.position(),
width = $target.innerWidth(),
loc = {
position: this.get('position') || "fixed",
left: position.left + width,
top: position.top
};
this.appEvents.trigger("popup-menu:open", loc);
this.sendAction("action");
}
});