Added popup

This commit is contained in:
Angelo Gallarello 2018-12-31 00:45:11 +01:00
parent a2d756074f
commit 196fef3a1b
6 changed files with 22 additions and 5 deletions

View file

@ -123,6 +123,15 @@
.trigger-text
font-size: 16px
display:inline-block
.trigger-inline-button
font-size: 16px
display: inline;
padding: 6px;
border: 1px solid #eee
border-radius: 4px
box-shadow: inset -1px -1px 3px rgba(0,0,0,.05)
&:hover, &.is-active
box-shadow: 0 0 0 2px darken(white, 60%) inset
.trigger-text.trigger-text-email
margin-left: 5px;
margin-top: 10px;

View file

@ -6,4 +6,10 @@ template(name="rulesMain")
if($eq rulesCurrentTab.get 'action')
+rulesActions(ruleName=ruleName triggerVar=triggerVar)
if($eq rulesCurrentTab.get 'ruleDetails')
+ruleDetails(ruleId=ruleId)
+ruleDetails(ruleId=ruleId)
template(name="boardCardTitlePopup")
form
label
| Card Title Filter
input.js-board-name(type="text" value=title autofocus)

View file

@ -31,6 +31,7 @@ BlazeComponent.extendComponent({
Triggers.remove(rule.triggerId);
},
'click .js-open-card-title-popup': Popup.open('boardCardTitle'),
'click .js-goto-trigger' (event) {
event.preventDefault();
const ruleTitle = this.find('#ruleTitle').value;

View file

@ -21,6 +21,8 @@ template(name="boardTriggers")
div.trigger-content
div.trigger-text
| {{_'r-when-a-card-is'}}
div.trigger-inline-button.js-open-card-title-popup
i.fa.fa-filter
div.trigger-text
| {{_'r-added-to'}}
div.trigger-text

View file

@ -27,11 +27,9 @@ window.Popup = new class {
open(name) {
const self = this;
const popupName = `${name}Popup`;
function clickFromPopup(evt) {
return $(evt.target).closest('.js-pop-over').length !== 0;
}
return function(evt) {
// If a popup is already opened, clicking again on the opener element
// should close it -- and interrupt the current `open` function.
@ -57,7 +55,6 @@ window.Popup = new class {
self._stack = [];
openerElement = evt.currentTarget;
}
$(openerElement).addClass('is-active');
evt.preventDefault();
@ -139,6 +136,7 @@ window.Popup = new class {
const openerElement = this._getTopStack().openerElement;
$(openerElement).removeClass('is-active');
this._stack = [];
}
}
@ -200,7 +198,7 @@ escapeActions.forEach((actionName) => {
() => Popup[actionName](),
() => Popup.isOpen(),
{
noClickEscapeOn: '.js-pop-over',
noClickEscapeOn: '.js-pop-over,.js-open-card-title-popup',
enabledOnClick: actionName === 'close',
}
);

View file

@ -467,6 +467,7 @@
"error-notAuthorized": "You are not authorized to view this page.",
"outgoing-webhooks": "Outgoing Webhooks",
"outgoingWebhooksPopup-title": "Outgoing Webhooks",
"boardCardTitlePopup-title": "Card Title Filter",
"new-outgoing-webhook": "New Outgoing Webhook",
"no-name": "(Unknown)",
"Node_version": "Node version",