Fixed auto height.
This commit is contained in:
parent
eae1351c37
commit
d2f84ab55b
1 changed files with 9 additions and 6 deletions
|
@ -6,8 +6,9 @@ class App.TagWidget extends App.Controller
|
||||||
@load()
|
@load()
|
||||||
|
|
||||||
load: =>
|
load: =>
|
||||||
|
@attribute_id = 'tags_' + @object.id + '_' + @object_type
|
||||||
App.Com.ajax(
|
App.Com.ajax(
|
||||||
id: 'tags_' + @object.id + '_' + @object_type
|
id: @attribute_id
|
||||||
type: 'GET'
|
type: 'GET'
|
||||||
url: 'api/tags'
|
url: 'api/tags'
|
||||||
data:
|
data:
|
||||||
|
@ -23,15 +24,16 @@ class App.TagWidget extends App.Controller
|
||||||
# insert data
|
# insert data
|
||||||
@html App.view('tag_widget')(
|
@html App.view('tag_widget')(
|
||||||
tags: tags || [],
|
tags: tags || [],
|
||||||
|
tag_id: @attribute_id
|
||||||
)
|
)
|
||||||
@el.find('#tags').tagsInput(
|
@el.find('#' + @attribute_id ).tagsInput(
|
||||||
width: '150px'
|
width: '150px'
|
||||||
defaultText: App.i18n.translateContent('add a Tag')
|
defaultText: App.i18n.translateContent('add a Tag')
|
||||||
onAddTag: @onAddTag
|
onAddTag: @onAddTag
|
||||||
onRemoveTag: @onRemoveTag
|
onRemoveTag: @onRemoveTag
|
||||||
# height: '65px'
|
# height: '65px'
|
||||||
)
|
)
|
||||||
@delay @siteUpdate, 100
|
@delay @siteUpdate, 200
|
||||||
|
|
||||||
# @el.find('#tags').elastic()
|
# @el.find('#tags').elastic()
|
||||||
|
|
||||||
|
@ -62,8 +64,9 @@ class App.TagWidget extends App.Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
siteUpdate: (reorder) =>
|
siteUpdate: (reorder) =>
|
||||||
container = document.getElementById("tags_tagsinput")
|
container = document.getElementById(@attribute_id + '_tagsinput')
|
||||||
if reorder
|
if reorder
|
||||||
$('#tags_tagsinput').height( 20 )
|
$('#' + @attribute_id + '_tagsinput').height( 20 )
|
||||||
height = container.scrollHeight
|
height = container.scrollHeight
|
||||||
$('#tags_tagsinput').height( height - 10 )
|
console.log(2222, height)
|
||||||
|
$('#' + @attribute_id + '_tagsinput').height( height - 10 )
|
||||||
|
|
Loading…
Reference in a new issue