Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
48
gaia/apps/wappush/js/link_action_handler.js
Executable file
48
gaia/apps/wappush/js/link_action_handler.js
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
|
||||
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
|
||||
|
||||
/* global ActivityPicker */
|
||||
|
||||
(function(exports) {
|
||||
'use strict';
|
||||
|
||||
var inProgress = false;
|
||||
|
||||
var LinkActionHandler = {
|
||||
onClick: function lah_onClick(event) {
|
||||
var dataset = event.target.dataset;
|
||||
var action = dataset.action;
|
||||
var type;
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if (!action) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* To avoid activity pile up, return immediately if the last activity is
|
||||
* still in progress. */
|
||||
if (inProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
inProgress = true;
|
||||
|
||||
type = action.replace('-link', '');
|
||||
|
||||
/* Use `LinkActionHandler.reset` (this.reset) as BOTH the success and
|
||||
* error callback. This ensure that any activities will be freed
|
||||
* regardless of their resulting state. */
|
||||
|
||||
ActivityPicker[type](
|
||||
dataset[type], this.reset, this.reset
|
||||
);
|
||||
},
|
||||
|
||||
reset: function lah_reset() {
|
||||
inProgress = false;
|
||||
}
|
||||
};
|
||||
|
||||
exports.LinkActionHandler = LinkActionHandler;
|
||||
}(this));
|
||||
Loading…
Reference in a new issue