CC-3463 : Usability improvements for timeline

started to add cursor options to context menu.
This commit is contained in:
Naomi Aro 2012-03-27 15:46:25 +02:00
parent 296a5c583a
commit dfc6ae6273
2 changed files with 27 additions and 2 deletions

View File

@ -99,7 +99,7 @@ class ShowbuilderController extends Zend_Controller_Action
public function contextMenuAction()
{
$id = $this->_getParam('id');
$now = time();
$now = floatval(microtime(true));
$request = $this->getRequest();
$baseUrl = $request->getBaseUrl();
@ -111,7 +111,12 @@ class ShowbuilderController extends Zend_Controller_Action
$item = CcScheduleQuery::create()->findPK($id);
$instance = $item->getCcShowInstances();
if ($now < intval($item->getDbEnds("U")) && $user->canSchedule($instance->getDbShowId())) {
if ($now < floatval($item->getDbEnds("U.u")) && $user->canSchedule($instance->getDbShowId())) {
//select the cursor
$menu["selCurs"] = array("name"=> "Select Cursor");
$menu["delCurs"] = array("name"=> "Remove Cursor");
//remove/truncate the item from the schedule
$menu["del"] = array("name"=> "Delete", "icon" => "delete", "url" => "/showbuilder/schedule-remove");
}

View File

@ -792,6 +792,26 @@ var AIRTIME = (function(AIRTIME){
data = $tr.data("aData");
function processMenuItems(oItems) {
//define a select cursor.
if (oItems.selCurs !== undefined) {
callback = function() {
$(this).parents('tr').next().addClass("cursor-selected-row");
};
oItems.selCurs.callback = callback;
}
//define a remove cursor.
if (oItems.delCurs !== undefined) {
callback = function() {
$(this).parents('tr').next().removeClass("cursor-selected-row");
};
oItems.delCurs.callback = callback;
}
//define a delete callback.
if (oItems.del !== undefined) {