This repository has been archived by the owner on May 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tooltip): hide tooltip when
esc
is hit
- Loading branch information
Showing
5 changed files
with
118 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
angular.module('ui.bootstrap.stackedMap', []) | ||
/** | ||
* A helper, internal data structure that acts as a map but also allows getting / removing | ||
* elements in the LIFO order | ||
*/ | ||
.factory('$$stackedMap', function() { | ||
return { | ||
createNew: function() { | ||
var stack = []; | ||
|
||
return { | ||
add: function(key, value) { | ||
stack.push({ | ||
key: key, | ||
value: value | ||
}); | ||
}, | ||
get: function(key) { | ||
for (var i = 0; i < stack.length; i++) { | ||
if (key == stack[i].key) { | ||
return stack[i]; | ||
} | ||
} | ||
}, | ||
keys: function() { | ||
var keys = []; | ||
for (var i = 0; i < stack.length; i++) { | ||
keys.push(stack[i].key); | ||
} | ||
return keys; | ||
}, | ||
top: function() { | ||
return stack[stack.length - 1]; | ||
}, | ||
remove: function(key) { | ||
var idx = -1; | ||
for (var i = 0; i < stack.length; i++) { | ||
if (key == stack[i].key) { | ||
idx = i; | ||
break; | ||
} | ||
} | ||
return stack.splice(idx, 1)[0]; | ||
}, | ||
removeTop: function() { | ||
return stack.splice(stack.length - 1, 1)[0]; | ||
}, | ||
length: function() { | ||
return stack.length; | ||
} | ||
}; | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters