mirror of
https://github.com/atom/atom.git
synced 2026-02-18 10:31:54 -05:00
Use a dropdown button for package actions
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{View} = require 'space-pen'
|
||||
requireWithGlobals 'bootstrap/js/bootstrap-dropdown', jQuery: require 'jquery'
|
||||
|
||||
module.exports =
|
||||
class PackageConfigView extends View
|
||||
@@ -6,7 +7,11 @@ class PackageConfigView extends View
|
||||
@div class: 'panel', =>
|
||||
@div outlet: 'heading', class: 'panel-heading', =>
|
||||
@span outlet: 'name'
|
||||
@button outlet: 'action', class: 'btn btn-small btn-primary pull-right'
|
||||
@div class: 'btn-group pull-right', =>
|
||||
@button outlet: 'action', class: 'btn btn-small btn-primary'
|
||||
@button class: 'btn btn-small btn-primary dropdown-toggle', 'data-toggle': 'dropdown', =>
|
||||
@span class: 'caret'
|
||||
@ul class: 'dropdown-menu', outlet: 'dropdown'
|
||||
@div outlet: 'description'
|
||||
@div outlet: 'versions', class: 'panel-footer'
|
||||
|
||||
|
||||
@@ -221,6 +221,20 @@ window.getDeserializer = (state) ->
|
||||
delete deferredDeserializers[name]
|
||||
deserializers[name]
|
||||
|
||||
window.requireWithGlobals = (id, globals={}) ->
|
||||
existingGlobals = {}
|
||||
for key, value of globals
|
||||
existingGlobals[key] = window[key]
|
||||
window[key] = value
|
||||
|
||||
require(id)
|
||||
|
||||
for key, value of existingGlobals
|
||||
if value is undefined
|
||||
delete window[key]
|
||||
else
|
||||
window[key] = value
|
||||
|
||||
window.measure = (description, fn) ->
|
||||
start = new Date().getTime()
|
||||
value = fn()
|
||||
|
||||
Reference in New Issue
Block a user