Skip to content

Commit

Permalink
Build.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Humphreys committed Mar 6, 2020
1 parent 975c147 commit 0aef59a
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 2 deletions.
14 changes: 14 additions & 0 deletions dist/tribute.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,20 @@ class Tribute {
new TributeSearch(this);
}

get isActive() {
return this._isActive;
}

set isActive(val) {
if (this._isActive != val) {
this._isActive = val;
if (this.current.element) {
let noMatchEvent = new CustomEvent(`tribute-active-${val}`);
this.current.element.dispatchEvent(noMatchEvent);
}
}
}

static defaultSelectTemplate(item) {
if (typeof item === "undefined") return null;
if (this.range.isContentEditable(this.current.element)) {
Expand Down
15 changes: 15 additions & 0 deletions dist/tribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,21 @@
}
});
}
}, {
key: "isActive",
get: function get() {
return this._isActive;
},
set: function set(val) {
if (this._isActive != val) {
this._isActive = val;

if (this.current.element) {
var noMatchEvent = new CustomEvent("tribute-active-".concat(val));
this.current.element.dispatchEvent(noMatchEvent);
}
}
}
}], [{
key: "defaultSelectTemplate",
value: function defaultSelectTemplate(item) {
Expand Down
2 changes: 1 addition & 1 deletion dist/tribute.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tribute.min.js.map

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions example/tribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,21 @@
}
});
}
}, {
key: "isActive",
get: function get() {
return this._isActive;
},
set: function set(val) {
if (this._isActive != val) {
this._isActive = val;

if (this.current.element) {
var noMatchEvent = new CustomEvent("tribute-active-".concat(val));
this.current.element.dispatchEvent(noMatchEvent);
}
}
}
}], [{
key: "defaultSelectTemplate",
value: function defaultSelectTemplate(item) {
Expand Down
34 changes: 34 additions & 0 deletions tribute.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.tribute-container {
position: absolute;
top: 0;
left: 0;
height: auto;
max-height: 300px;
max-width: 500px;
overflow: auto;
display: block;
z-index: 999999;
}
.tribute-container ul {
margin: 0;
margin-top: 2px;
padding: 0;
list-style: none;
background: #efefef;
}
.tribute-container li {
padding: 5px 5px;
cursor: pointer;
}
.tribute-container li.highlight {
background: #ddd;
}
.tribute-container li span {
font-weight: bold;
}
.tribute-container li.no-match {
cursor: default;
}
.tribute-container .menu-highlighted {
font-weight: bold;
}

0 comments on commit 0aef59a

Please sign in to comment.