You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Ben Keen (JIRA)" <ji...@apache.org> on 2014/10/23 22:10:34 UTC
[jira] [Updated] (COUCHDB-2401) Refactor: tray open/close events
[ https://issues.apache.org/jira/browse/COUCHDB-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ben Keen updated COUCHDB-2401:
------------------------------
Description:
Small thing, but significant. Right now we're explicitly telling other components to do things, like in the Query Options / API Bar that tell eachother to close if they're about to be opened:
FauxtonAPI.Events.trigger("APIbar:closeTray");
Now that the Add New Database is going to be a tray as well, change this to make it more generic. Namely, all of them would publish the same events:
FauxtonAPI.Events.trigger("Tray:open");
FauxtonAPI.Events.trigger("Tray:close");
They would then use that to subscribe to ANY tray's open event, and know to close itself if another's being opened. The benefits are that a component doesn't need to know about other components (loose coupling yay). And going forth it would mean less code.
Also, the event string itself should be placed in the new constants.js.
was:
Small thing, but significant. Right now we're explicitly telling other components to do things, like in the Query Options / API Bar that tell eachother to close if they're about to be opened:
FauxtonAPI.Events.trigger("APIbar:closeTray");
Now that the Add New Database is going to be a tray as well, change this to make it more generic. Namely, all of them would publish the same events:
FauxtonAPI.Events.trigger("Tray:open");
FauxtonAPI.Events.trigger("Tray:close");
They would then use that to subscribe to ANY tray's open event, and know to close itself if another's being opened.
[Also, the event string itself should be placed in the new constants.js].
> Refactor: tray open/close events
> --------------------------------
>
> Key: COUCHDB-2401
> URL: https://issues.apache.org/jira/browse/COUCHDB-2401
> Project: CouchDB
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: Fauxton
> Reporter: Ben Keen
> Assignee: Ben Keen
>
> Small thing, but significant. Right now we're explicitly telling other components to do things, like in the Query Options / API Bar that tell eachother to close if they're about to be opened:
> FauxtonAPI.Events.trigger("APIbar:closeTray");
> Now that the Add New Database is going to be a tray as well, change this to make it more generic. Namely, all of them would publish the same events:
> FauxtonAPI.Events.trigger("Tray:open");
> FauxtonAPI.Events.trigger("Tray:close");
> They would then use that to subscribe to ANY tray's open event, and know to close itself if another's being opened. The benefits are that a component doesn't need to know about other components (loose coupling yay). And going forth it would mean less code.
> Also, the event string itself should be placed in the new constants.js.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)