diff --git a/module/story/control.php b/module/story/control.php index 804877cb93..4434369984 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -395,7 +395,7 @@ class story extends control $this->commonAction($storyID); $story = $this->view->story; - if($story->status != 'active') return print(js::locate($this->session->storyList, 'parent')); + if($story->status != 'active') return $this->send(array('result' => 'success', 'load' => $this->session->storyList)); $this->story->getAffectedScope($story); /* Assign. */ diff --git a/module/story/js/processstorychange.ui.js b/module/story/js/processstorychange.ui.js new file mode 100644 index 0000000000..cbc323fab7 --- /dev/null +++ b/module/story/js/processstorychange.ui.js @@ -0,0 +1,6 @@ +window.closeModal = function(e) +{ + let $modal = $(e.target).closest('.modal'); + const modalID = $modal.attr('id'); + zui.Modal.hide('#' + modalID); +} diff --git a/module/story/ui/processstorychange.html.php b/module/story/ui/processstorychange.html.php index b65aaf0915..42f2a40f1c 100644 --- a/module/story/ui/processstorychange.html.php +++ b/module/story/ui/processstorychange.html.php @@ -33,9 +33,10 @@ foreach($changedStories as $story) div ( + on::click('.changeBtn', 'closeModal'), setClass('actions text-center mt-3'), - btn(set::url(inlink('processstorychange', "id=$storyID&result=no")), setClass('secondary mr-5 btn-wide'), $lang->story->changeList['no']), - btn(set::url(inlink('change', "id=$storyID")), setClass('primary btn-wide'), $lang->story->changeList['yes']), + btn(set::url(inlink('processstorychange', "id=$storyID&result=no")), setClass('secondary changeBtn mr-5 btn-wide'), $lang->story->changeList['no']), + $story->status != 'active' ? null : btn(set::url(inlink('change', "id=$storyID")), setClass('primary changeBtn btn-wide'), $lang->story->changeList['yes']), ); render();