[Plugins] Bring over timeline, clock plugins
WTD-1239
This commit is contained in:
33
platform/features/clock/src/actions/RestartTimerAction.js
Normal file
33
platform/features/clock/src/actions/RestartTimerAction.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
['./AbstractStartTimerAction'],
|
||||
function (AbstractStartTimerAction) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Implements the "Restart at 0" action.
|
||||
*
|
||||
* Behaves the same as (and delegates functionality to)
|
||||
* the "Start" action.
|
||||
* @implements Action
|
||||
*/
|
||||
function RestartTimerAction(now, context) {
|
||||
return new AbstractStartTimerAction(now, context);
|
||||
}
|
||||
|
||||
RestartTimerAction.appliesTo = function (context) {
|
||||
var model =
|
||||
(context.domainObject && context.domainObject.getModel())
|
||||
|| {};
|
||||
|
||||
// We show this variant for timers which already have
|
||||
// a target time.
|
||||
return model.type === 'warp.timer' &&
|
||||
model.timestamp !== undefined;
|
||||
};
|
||||
|
||||
return RestartTimerAction;
|
||||
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user