92 Commits

Author SHA1 Message Date
Jess Lin
6319c9722a [Gutter][View Registry] Add Gutter view providers to the ViewRegistry 2015-04-22 07:28:58 -07:00
Kevin Sawicki
b54177eb5e Remove property always set in constructor 2015-04-06 15:14:26 -07:00
Kevin Sawicki
96b95b74e9 Conditionally include Pane model properties and behaviors 2015-04-06 11:04:10 -07:00
Kevin Sawicki
312c03e6d2 Conditionally include activePane/activePaneItem properties 2015-04-06 11:04:10 -07:00
Kevin Sawicki
590a4b0fd5 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Kevin Sawicki
fd1d872840 Prompt split editors to save on close
Previously an editor that was split into multiple panes would not
prompt to save correctly when the window was unloading.

This adds a new `windowCloseRequested` option passed through from the
beforeunload handler to the editor so that it can specially handle this
case.

Closes #5257
2015-02-04 17:14:46 -08:00
Cheng Zhao
93181d8a54 Array::find is undefined in Chrome 40 2015-01-28 14:06:14 -08:00
Nathan Sobo
7f8ab72f53 Capitalize initialisms
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 22:00:24 -08:00
Nathan Sobo
fbc9c05096 Add Workspace::onDidDestroyPane
This helps with the background-tips conversion
2014-12-02 11:57:38 -07:00
Nathan Sobo
1eab423a1c Clarify that we’re taking an event in the parameter name 2014-12-02 11:57:38 -07:00
Nathan Sobo
9a9347e3a5 Simplify ViewRegistry::addViewProvider API
It now takes two arguments, a model constructor and a create view
callback that is passed the model.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-12-01 17:53:03 -08:00
Nathan Sobo
4591f00a65 Remove view registry references from the workspace model layer
Removed various ::getView methods from the model. Using the atom.views
global in the views for now, but going to switch them over to using a
locally assigned view registry instead in a subsequent commit.
2014-12-01 16:28:33 -08:00
Nathan Sobo
7dc9d0c8ce Add Workspace::onWillDestroyPaneItem
It is needed by the autosave package which previously relied on DOM
bubbling to coalesce events from various panes.
2014-12-01 10:39:29 -07:00
Nathan Sobo
0a92b6b681 Add Workspace::paneForItem 2014-11-10 08:20:59 -07:00
Nathan Sobo
b8d2bd6c30 Disallow activation of panes that aren't in the PaneContainer
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-07 15:46:47 -07:00
Nathan Sobo
6934b83acc Fall back to first pane if activePaneId is invalid
When deserializing PaneContainer.

Fixes #4069

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2014-11-07 15:44:59 -07:00
Nathan Sobo
003b67ee19 Add TextEditorElement and make TextEditorView a wrapper around it
This is the next step on converting all internal views to custom
elements instead of using SpacePen. The TextEditorElement instances
are associated with ::__spacePenView fields that are used for supporting
legacy access paths via atom.workspaceView.
2014-10-08 12:13:13 -07:00
Nathan Sobo
1c58438124 Move PaneContainerView::confirmClose to the model layer 2014-09-24 15:46:01 -06:00
Nathan Sobo
465d2afd95 Remove the old root view properly 2014-09-24 15:28:34 -06:00
Nathan Sobo
da87f321e8 Add PaneAxisElement 2014-09-24 15:28:34 -06:00
Nathan Sobo
2710c06313 WIP: First stab at custom element for panes
Still need to create a SpacePen shim for access via `atom.workspaceView`
property so we’re backward compatible with packages, but it basically
works.
2014-09-24 15:28:33 -06:00
Nathan Sobo
55cce48af1 Throw an exception if the same pane item is added twice in the workspace 2014-09-19 16:24:13 -06:00
Nathan Sobo
0877721ce9 Construct PaneAxisViews and PaneViews via ViewRegistry 2014-09-19 16:24:12 -06:00
Nathan Sobo
53bd1c8958 Use Workspace::getView to build PaneContainerView 2014-09-19 16:24:12 -06:00
Nathan Sobo
a33706ddbc Add PaneContainer::onDidAddPaneItem and ::observePaneItems 2014-08-28 17:42:12 -06:00
Nathan Sobo
cee7539e35 Add PaneContainer::observePanes and ::onDidAddPane 2014-08-28 17:22:28 -06:00
Nathan Sobo
5471e9bccc Add PaneContainer::onDidDestroyPaneItem 2014-08-28 16:58:38 -06:00
Nathan Sobo
9223361c22 Add PaneContainer::onDidChange/observeRoot
Also, don’t use a behavior to monitor root changes
2014-08-28 14:42:13 -06:00
Nathan Sobo
74b2f26540 Add PaneContainer::onDidChangeActivePaneItem 2014-08-28 14:41:56 -06:00
Nathan Sobo
87cdc1a45d Don’t invoke ::onDidChangeActivePane events unless it really changes 2014-08-28 11:43:08 -06:00
Nathan Sobo
2b63f8a4ee Add PaneContainer::onDidChangeActivePane 2014-08-28 11:43:07 -06:00
Nathan Sobo
2d58d9c8b5 Add Pane::onDidActivate 2014-08-28 11:43:07 -06:00
Nathan Sobo
b2c70f9e69 Move serialization of active pane from Pane to PaneContainer
Fixes #2694
Fixel #2853

Previously, we were storing an `active` boolean for each pane. We've
had some strange bugs where every pane is serializing `active: false`,
which causes exceptions when loading up the stored data.

This new approach serializes the activePaneId on the PaneContainer
itself. Since the PaneContainer is the source of truth regarding the
active pane, it makes more sense to handle it here.

This unfortunately changes the serialization version for the
PaneContainer, so people won't have their state persisted after
upgrading. But it seems better than leaving cruft to handle the old
serialization situation.
2014-07-07 16:36:10 -06:00
Corey Johnson
d6ec73886f Add PaneContainer::getActivePane 2014-04-15 14:55:28 -07:00
Kevin Sawicki
932a792289 Remove Private: prefix 2014-02-06 10:02:53 -08:00
Nathan Sobo
ccd86d91de Make PaneContainer::activePaneItem behavior distinct until changed
If we switch from one empty active pane to another empty active pane,
there's no reason to emit a value from the activePaneItem behavior.
2014-01-15 16:08:36 -07:00
Nathan Sobo
5e14d44d6a Destroy all pane models when workspace view is removed 2014-01-15 16:07:47 -07:00
Nathan Sobo
9af4b14716 Never allow PaneContainer::root to be null 2014-01-15 16:07:47 -07:00
Nathan Sobo
1a48903f96 Only destroy empty panes on deserialization if config option is enabled 2014-01-15 16:07:47 -07:00
Nathan Sobo
4a7b43f609 Write focusNext/PreviousPane in terms of activateNext/PreviousPane
"Activate" is the model level equivalent of focus.
2014-01-14 11:15:14 -07:00
Nathan Sobo
89cbd6b834 Move PaneContainerView::saveAll to the model 2014-01-14 10:58:35 -07:00
Nathan Sobo
a8ddc530a2 Emit a pane-item-destroyed event from the workspace model
…Instead of calling itemDestroyed on the workspace view via a DOM query
2014-01-14 10:58:34 -07:00
Nathan Sobo
7317d52896 Move paneForUri to PaneContainer model 2014-01-14 10:58:34 -07:00
Nathan Sobo
97999f1080 Rename PaneContainerModel to PaneContainer 2014-01-13 13:56:31 -07:00
Nathan Sobo
918c31905f Rename PaneContainer to PaneContainerView 2014-01-13 13:46:28 -07:00
Nathan Sobo
4f604ced3c Rename Pane to PaneView 2014-01-13 13:46:22 -07:00
Nathan Sobo
3fc3d48def Destroy empty panes after deserializing
Fixes #1399
2014-01-12 17:53:25 -07:00
Nathan Sobo
28b085be1c Rename ::makeActive to ::activate and focus panes when they're activated 2014-01-11 20:48:01 -07:00
Nathan Sobo
3ab7836ab2 Upgrade to emissary 0.31.0 for implicit 'value' subscriptions on signals
Previously, when you always had to specify the event name of 'value'
when calling `::subscribe` with a signal. Now, if you don't specify an
event name, 'value' is assumed.
2014-01-11 11:22:31 -07:00
Nathan Sobo
e2170ea907 Remove unused requires and mixins 2014-01-11 10:45:33 -07:00