Fix clicking on file name toggles checkbox

This commit is contained in:
Nathan Gray 2013-10-01 16:27:50 +00:00
parent 4449e9a44b
commit 04ce0638a9
3 changed files with 4 additions and 6 deletions

View File

@ -275,7 +275,7 @@ class filemanager_select
'mime' => $mime, 'mime' => $mime,
'onclick' => $is_dir ? "return app.filemanager.select_goto('".addslashes($path)."'".($et2?',widget':'').");" : 'onclick' => $is_dir ? "return app.filemanager.select_goto('".addslashes($path)."'".($et2?',widget':'').");" :
($content['mode'] != 'open-multiple' ? "return app.filemanager.select_show('".addslashes($name)."');" : ($content['mode'] != 'open-multiple' ? "return app.filemanager.select_show('".addslashes($name)."');" :
"return app.filemanager.select_toggle('".addslashes($name)."');"), "return app.filemanager.select_toggle('".addslashes($name)."',widget);"),
); );
if ($is_dir && $content['mode'] == 'open-multiple') if ($is_dir && $content['mode'] == 'open-multiple')
{ {

View File

@ -673,10 +673,8 @@ app.filemanager = AppJS.extend(
editfield.value = file; editfield.value = file;
return false; return false;
}, },
select_toggle: function(file) select_toggle: function(file,widget)
{ {
checkbox = document.getElementById("exec[dir][selected]["+file+"]"); widget._parent.getWidgetById('selected['+file+']').set_value(file);
if (checkbox) checkbox.checked = !checkbox.checked;
return false;
} }
}); });

View File

@ -50,7 +50,7 @@
<row class="row"> <row class="row">
<vfs-mime align="center" id="$row" options="16" class="selectIcon"/> <vfs-mime align="center" id="$row" options="16" class="selectIcon"/>
<vfs id="$row" onclick="$row_cont[onclick]"/> <vfs id="$row" onclick="$row_cont[onclick]"/>
<checkbox align="right" id="selected[]" options="&quot;$row_cont[name]&quot;"/> <checkbox align="right" id="selected[{$row_cont[name]}]" options="&quot;$row_cont[name]&quot;"/>
</row> </row>
</rows> </rows>
</grid> </grid>