diff --git a/demo/index.html b/demo/index.html
index f1d93f2..a4a2891 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -15,6 +15,7 @@
diff --git a/elements/uqlibrary-toolbar.html b/elements/uqlibrary-toolbar.html
index 101b603..5d0435c 100644
--- a/elements/uqlibrary-toolbar.html
+++ b/elements/uqlibrary-toolbar.html
@@ -42,24 +42,13 @@
[[headerTitle]]
+
+
+
+
-
-
-
-
-
-
-
- [[link.label]]
-
-
-
-
-
-
diff --git a/elements/uqlibrary-toolbar.js b/elements/uqlibrary-toolbar.js
index 3e16ba8..23e3880 100644
--- a/elements/uqlibrary-toolbar.js
+++ b/elements/uqlibrary-toolbar.js
@@ -1,39 +1,31 @@
Polymer({
is: 'uqlibrary-toolbar',
properties: {
-
- /*
- * A list of items to be displayed in more actions menu
- * item.label is displayed
- * */
- appLinks: {
- type: Array,
- value: function () {
- return [];
- }
- },
-
/*
* Flag to enable/disable search bar
* */
enableSearch: {
type: Object
},
-
+ /**
+ * Whether to show the "Clear Search" button
+ */
+ enableSearchClear: {
+ type: Object,
+ value: false
+ },
/*
* Flag to enable/disable menu button
* */
enableMenu: {
type: Object
},
-
/*
* String to display on toolbar
* */
headerTitle: {
type: String
},
-
/*
* Autosuggestion property to display in drop down
* */
@@ -41,7 +33,6 @@ Polymer({
type: String,
value: 'name'
},
-
/*
* Default text in search input field
* */
@@ -49,7 +40,6 @@ Polymer({
type: String,
value: 'Search...'
},
-
/*
* Search term keyword
* */
@@ -57,7 +47,6 @@ Polymer({
type: String,
notify: true
},
-
/*
* A list of suggestions to be displayed when user types in keyword
* */
@@ -67,14 +56,11 @@ Polymer({
return [];
}
},
-
_searchInProgress: {
type: Boolean,
value: false
}
-
},
-
_showSearch: function() {
if (this._searchInProgress === false)
this._searchInProgress = true;
@@ -83,12 +69,10 @@ Polymer({
this.$$('#asi').$.inputKeyword.focus();
}, 5);
},
-
_hideSearch: function() {
if (this._searchInProgress === true)
this._searchInProgress = false;
},
-
_searchActivated: function(e) {
this._hideSearch();
@@ -102,16 +86,13 @@ Polymer({
this.fire("uqlibrary-toolbar-search-submitted", searchObject );
},
-
_actionSelected: function(e) {
this.fire('uqlibrary-toolbar-link-clicked', this.appLinks[e.detail.selected]);
},
-
_menuActivated: function () {
this.fire('uqlibrary-toolbar-menu-clicked');
},
-
- _hasAppLinks: function (appLinks) {
- return appLinks.length > 0;
+ _clearSearch: function () {
+ this.fire('uqlibrary-toolbar-clear-search-clicked');
}
});
\ No newline at end of file
diff --git a/test/uqlibrary-toolbar-test.html b/test/uqlibrary-toolbar-test.html
index d8afeae..bce13f7 100644
--- a/test/uqlibrary-toolbar-test.html
+++ b/test/uqlibrary-toolbar-test.html
@@ -58,50 +58,11 @@
var searchIcon = element.querySelector('#searchButton');
expect(searchIcon).to.be.null;
- // app links, not returns true even without applinks, just says the icon is there
- var appLinksIcon = element.querySelector('#actionsButton');
- expect(appLinksIcon).to.be.null;
-
done();
});
});
- test('should display search/app links toolbar items', function (done) {
- flush(function () {
-
- element.enableSearch = true;
- element.appLinks =[{"label": "Switch back", "action": "#"}, {"label": "Help", "url": "#"}, {"label": "Feedback", "url": "#"}];
-
- setTimeout(function () {
-
- // menu icon
- var menuIcon = element.querySelector('#hamburgerMenuIcon');
- expect(menuIcon).not.to.be.null;
- expect(menuIcon).to.be.visible;
-
- // search icon
- var searchIcon = element.querySelector('#searchButton');
- expect(searchIcon).not.to.be.null;
- expect(searchIcon).to.be.visible;
-
- // app links, not returns true even without applinks, just says the icon is there
- var appLinksIcon = element.querySelector('#actionsButton');
- expect(appLinksIcon).not.to.be.null;
- expect(appLinksIcon).to.be.visible;
-
- // app links, not returns true even without applinks, just says the icon is there
- var toolbarTitle = element.querySelector('.title');
- expect(toolbarTitle).not.to.be.null;
- expect(toolbarTitle).to.be.visible;
- expect(toolbarTitle.innerHTML).to.equal('Application Name');
- console.log(toolbarTitle.innerHTML);
-
- done();
- }, 10);
-
- });
- });
test('should display search input when search button is tapped', function (done) {