fixed: Thingy: "cancel" -- cannot cancel when adding a thing

This commit is contained in:
Yung Han Khoe 2008-04-02 13:20:55 +00:00
parent 357b2b3c5c
commit f72cf18011
3 changed files with 17 additions and 0 deletions

View file

@ -20,6 +20,7 @@
- fixed: Import/Export of packages with international text is broken
- fixed: CS rating links are exposed to site spiders
- improved behavior of CS mail message filtering
- fixed: Thingy: "cancel" -- cannot cancel when adding a thing
7.5.8
- moved Gallery utility methods to WebGUI::Utility::Gallery

View file

@ -1159,6 +1159,10 @@ sub www_editThing {
$tab->raw('var hasSize = {'.join(", ",map {'"'.$_.'": true'} @hasSize).'};');
$tab->raw('var hasVertical = {'.join(", ",map {'"'.$_.'": true'} @hasVertical).'};');
$tab->raw('var hasValues = {'.join(", ",map {'"'.$_.'": true'} @hasValues).'};');
if ($session->form->process("thingId") eq 'new'){
$tab->raw("var newThingId = '$thingId';\n");
$tab->raw("YAHOO.util.Event.onDOMReady(setCancelButton);\n");
}
$tab->raw("</script>");
$tab->text(
@ -2092,6 +2096,7 @@ sub www_manage {
$var->{canEditThings} = $self->canEdit;
$var->{"addThing_url"} = $session->url->append($url, 'func=editThing;thingId=new');
$var->{"manage_url"} = $session->url->append($url, 'func=manage');
#Get things in this Thingy
$things = $self->session->db->read('select thingId, label, defaultView from Thingy_things '

View file

@ -1,3 +1,14 @@
function setCancelButton () {
var cancelButtons = YAHOO.util.Dom.getElementsByClassName('backwardButton','input','application_workarea');
function deleteTempThing () {
window.location.href = "?func=deleteThingConfirm;thingId="+newThingId;
}
for (var i = cancelButtons.length; i--; ) {
cancelButtons[i].onclick = deleteTempThing;
}
}
function initOptionalFields(prefix,fieldId) {
var fieldInThing_module_rendered;