Allow search terms with spaces. Fixed browser tests.

This commit is contained in:
Martin Edenhofer 2016-02-02 19:46:55 +01:00
parent 4f16f1b58a
commit 70ef23d99a
2 changed files with 8 additions and 7 deletions

View file

@ -237,6 +237,7 @@
}
this.buffer = ''
this.active = false
this.$widget.remove()
$(window).off('click.textmodule')
}
@ -367,7 +368,7 @@
this.log('result', term, result)
if (!result[0]) {
return this.close()
result = [{id:'', name: '-'}]
}
if (!this.active) {
@ -382,7 +383,7 @@
element.attr('data-id', item.id)
element.text(App.Utils.htmlEscape(item.name))
element.addClass('u-clickable u-textTruncate')
if (i == result.length-1) {
if (i == result.length-1 && item.id != '') {
element.addClass('is-active')
}
if (item.keywords) {
@ -390,7 +391,7 @@
}
elements = elements.add(element)
}
this.$widget.find('ul').append(elements).scrollTop(9999)
this.movePosition()
}

View file

@ -47,7 +47,7 @@ class AgentTicketActionLevel0Test < TestCase
value: :arrow_down,
slow: true,
)
click( css: '.active .shortcut > ul> li > a' )
click( css: '.active .shortcut > ul> li' )
watch_for(
css: '.active div[data-name=body]',
@ -134,7 +134,7 @@ class AgentTicketActionLevel0Test < TestCase
)
click(
browser: browser2,
css: '.active .shortcut > ul> li > a',
css: '.active .shortcut > ul> li',
)
watch_for(
@ -161,7 +161,7 @@ class AgentTicketActionLevel0Test < TestCase
)
click(
browser: browser2,
css: '.active .shortcut > ul> li > a',
css: '.active .shortcut > ul> li',
)
watch_for(
browser: browser2,
@ -205,7 +205,7 @@ class AgentTicketActionLevel0Test < TestCase
sleep 1
click(
browser: browser2,
css: '.active .shortcut > ul> li > a',
css: '.active .shortcut > ul> li',
)
watch_for(