* fixed a bug: page not reload when close modal on story/view.

This commit is contained in:
Catouse
2014-06-09 16:16:39 +08:00
parent 3b854e6224
commit bade5dfd2c
4 changed files with 10 additions and 14 deletions

View File

@@ -815,7 +815,7 @@ EOT;
* @access public
* @return void
*/
static public function closeModal($window = 'self', $location)
static public function closeModal($window = 'self', $location = '')
{
$js = self::start();
$js .= "if($window.location.href == self.location.href){ $window.window.close();}";

View File

@@ -438,7 +438,7 @@ class story extends control
$actionID = $this->action->create('story', $storyID, 'Activated', $this->post->comment);
$this->sendmail($storyID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('story', 'view', "storyID=$storyID"), 'parent'));
}
@@ -611,7 +611,7 @@ class story extends control
$actionID = $this->action->create('story', $storyID, 'Closed', $this->post->comment, ucfirst($this->post->closedReason));
$this->action->logHistory($actionID, $changes);
$this->sendmail($storyID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate(inlink('view', "storyID=$storyID"), 'parent'));
}

View File

@@ -368,7 +368,7 @@ class task extends control
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -454,7 +454,7 @@ class task extends control
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -478,7 +478,7 @@ class task extends control
if(!empty($_POST))
{
$this->task->recordEstimate($taskID);
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -582,7 +582,7 @@ class task extends control
}
}
}
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -616,7 +616,7 @@ class task extends control
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -690,7 +690,7 @@ class task extends control
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}
@@ -724,7 +724,7 @@ class task extends control
$this->action->logHistory($actionID, $changes);
$this->sendmail($taskID, $actionID);
}
if(isonlybody()) die(js::closeModal('parent.parent'));
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
die(js::locate($this->createLink('task', 'view', "taskID=$taskID"), 'parent'));
}

View File

@@ -4,7 +4,3 @@ function assign(taskID, assignedTo)
$('.assign').height(40);
$('.assign').load(createLink('user', 'ajaxGetUser', 'taskID=' + taskID + '&assignedTo=' + assignedTo));
}
$(function()
{
if(onlybody != 'yes') $('.iframe').modalTrigger({width:900, type:'iframe', afterHide:function(){parent.location.href=parent.location.href;}});
})