Merge branch 'cj-update-markdown-preview'

Conflicts:
	src/pane.coffee
This commit is contained in:
probablycorey
2014-02-11 11:33:46 -08:00
4 changed files with 15 additions and 5 deletions

View File

@@ -169,7 +169,6 @@ addCustomMatchers = (spec) ->
element = element.get(0) if element.jquery
element.webkitMatchesSelector(":focus") or element.querySelector(":focus")
window.keyIdentifierForKey = (key) ->
if key.length > 1 # named key
key

View File

@@ -27,7 +27,7 @@ class PaneView extends View
'destroyItem', 'destroyItems', 'destroyActiveItem', 'destroyInactiveItems',
'saveActiveItem', 'saveActiveItemAs', 'saveItem', 'saveItemAs', 'saveItems',
'itemForUri', 'activateItemForUri', 'promptToSaveItem', 'copyActiveItem', 'isActive',
'activate', toProperty: 'model'
'activate', 'getActiveItem', toProperty: 'model'
previousActiveItem: null

View File

@@ -3,6 +3,7 @@
{Model, Sequence} = require 'theorist'
Serializable = require 'serializable'
PaneAxis = require './pane-axis'
Editor = require './editor'
PaneView = null
# Public: A container for multiple items, one of which is *active* at a given
@@ -91,6 +92,11 @@ class Pane extends Model
getActiveItem: ->
@activeItem
# Public: Returns an {Editor} if the pane item is an {Editor}, or null
# otherwise.
getActiveEditor: ->
@activeItem if @activeItem instanceof Editor
# Public: Returns the item at the specified index.
itemAtIndex: (index) ->
@items[index]
@@ -111,15 +117,15 @@ class Pane extends Model
else
@activateItemAtIndex(@items.length - 1)
# Public: Returns the index of the current active item.
# Returns the index of the current active item.
getActiveItemIndex: ->
@items.indexOf(@activeItem)
# Public: Makes the item at the given index active.
# Makes the item at the given index active.
activateItemAtIndex: (index) ->
@activateItem(@itemAtIndex(index))
# Public: Makes the given item active, adding the item if necessary.
# Makes the given item active, adding the item if necessary.
activateItem: (item) ->
if item?
@addItem(item)

View File

@@ -155,6 +155,11 @@ class Workspace extends Model
destroyActivePane: ->
@activePane?.destroy()
# Public: Returns an {Editor} if the active pane item is an {Editor},
# or null otherwise.
getActiveEditor: ->
@activePane?.getActiveEditor()
increaseFontSize: ->
atom.config.set("editor.fontSize", atom.config.get("editor.fontSize") + 1)