mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Show label when update is available
This commit is contained in:
parent
a518af71ea
commit
732c846cfc
@ -13,6 +13,7 @@ class PackageConfigView extends View
|
||||
@div outlet: 'heading', class: 'panel-heading', =>
|
||||
@span outlet: 'name'
|
||||
@span outlet: 'version', class: 'label'
|
||||
@span outlet: 'update', class: 'label label-info', 'Update Available'
|
||||
@div class: 'btn-group pull-right', =>
|
||||
@button outlet: 'defaultAction', class: 'btn btn-small btn-primary'
|
||||
@button outlet: 'dropdownButton', class: 'btn btn-small btn-primary dropdown-toggle', 'data-toggle': 'dropdown', =>
|
||||
@ -123,6 +124,7 @@ class PackageConfigView extends View
|
||||
|
||||
updatePackageState: ->
|
||||
@disabled = atom.isPackageDisabled(@pack.name)
|
||||
@updateAvailable = false
|
||||
@bundled = false
|
||||
loadedPackage = atom.getLoadedPackage(@pack.name)
|
||||
packagePath = loadedPackage?.path ? atom.resolvePackagePath(@pack.name)
|
||||
@ -138,6 +140,11 @@ class PackageConfigView extends View
|
||||
version = Package.loadMetadata(@pack.name).version
|
||||
@updateAvailable = semver.gt(@pack.version, version)
|
||||
|
||||
if @updateAvailable
|
||||
@update.show()
|
||||
else
|
||||
@update.hide()
|
||||
|
||||
updateEnabledState: ->
|
||||
enableLink = @enableToggle.find('a')
|
||||
if @disabled
|
||||
|
Loading…
Reference in New Issue
Block a user