Lots of tweaks, and angular demos

This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
Max Lynch
2013-08-24 14:14:45 -05:00
gitea-unlock(16/)
parent ae59de54bd
commit d9f1c23ee1
octicon-diff(16/tw-mr-1) 15 changed files with 195 additions and 33 deletions

2
js/framework/framework-buttons.js
View File

@@ -18,6 +18,8 @@
if(event.target && event.target.classList.contains('button')) {
event.target.classList.remove('active');
}
// TODO: Process the click? Set flag to not process other click events
};
document.addEventListener('touchstart', framework.Button.prototype._onTouchStart);

11
js/framework/framework-tabs.js
View File

@@ -1,20 +1,23 @@
(function(window, document, framework) {
framework.Tabs = function() {}
framework.Tabs.prototype._TAB_ITEM_CLASS = 'tab-item';
framework.Tabs.prototype._onTouchStart = function(event) {
console.log('Touch start!', event);
if(event.target && event.target.classList.contains('button')) {
if(event.target && event.target.parentNode.classList.contains(this._TAB_ITEM_CLASS)) {
event.target.classList.add('active');
}
};
framework.Tabs.prototype._onTouchEnd = function(event) {
console.log('Touch end!', event);
if(event.target && event.target.classList.contains('button')) {
if(event.target && event.target.parentNode.classList.contains(this._TAB_ITEM_CLASS)) {
event.target.classList.remove('active');
}
};
document.addEventListener('touchstart', framework.Button.prototype._onTouchStart);
document.addEventListener('touchend', framework.Button.prototype._onTouchEnd);
document.addEventListener('mousedown', framework.Tabs.prototype._onTouchStart);
document.addEventListener('touchstart', framework.Tabs.prototype._onTouchStart);
document.addEventListener('touchend', framework.Tabs.prototype._onTouchEnd);
})(this, document, this.FM = this.FM || {});