Merge pull request #658 from ItsLastDay/editor_tweaks

Added tooltip in level-editor (issue #174)
This commit is contained in:
Nick Winter 2014-03-22 17:30:52 -07:00
commit fd2d9b6833
2 changed files with 6 additions and 2 deletions

View file

@ -10,7 +10,7 @@ table.table
th(data-i18n="general.name") Name
th(data-i18n="general.description") Description
th(data-i18n="general.version") Version
for data in documents
- data = data.attributes;
tr
@ -18,4 +18,4 @@ table.table
a(href="/editor/level/#{data.slug || data._id}")
| #{data.name}
td.body-row #{data.description}
td #{data.version.major}.#{data.version.minor}
td #{data.version.major}.#{data.version.minor}

View file

@ -219,6 +219,7 @@ module.exports = class ThangsTabView extends View
# TODO: figure out a good way to have all Surface clicks and Treema clicks just proxy in one direction, so we can maintain only one way of handling selection and deletion
onExtantThangSelected: (e) ->
@selectedExtantSprite?.setNameLabel null unless @selectedExtantSprite is e.sprite
@selectedExtantThang = e.thang
@selectedExtantSprite = e.sprite
if e.thang and (key.alt or key.meta)
@ -230,6 +231,9 @@ module.exports = class ThangsTabView extends View
@selectedExtantThangClickTime = new Date()
treemaThang = _.find @thangsTreema.childrenTreemas, (treema) => treema.data.id is @selectedExtantThang.id
if treemaThang
# Show the label above selected thang, notice that we may get here from thang-edit-view, so it will be selected but no label
# also covers selecting from Treema
@selectedExtantSprite.setNameLabel @selectedExtantSprite.thangType.get('name') + ': ' + @selectedExtantThang.id
if not treemaThang.isSelected()
treemaThang.select()
@thangsTreema.$el.scrollTop(@thangsTreema.$el.find('.treema-children .treema-selected')[0].offsetTop)