Hi
I'm trying to make an edit button on the context menu, so when the user click it, the page will be redirected to another page to edit the selected file.
All is OK, but I want to disable the button when the selected item is a directory an enable when the item is a file.
I have the following code to change de CSS class, this is executed when a item is selected.
function OnFileSelected(sender, args) { |
var textbox = document.getElementById("ctl00_ContentPlaceHolder1_TextBox1"); |
var item = args.get_item(); |
textbox.value = item.get_path(); |
var menuEdit = document.getElementById("menuEdit"); |
if (item.isDirectory()) { |
menuEdit.setAttribute("class", "rmLink rmDisabled"); |
} |
else { |
menuEdit.setAttribute("class", "rmLink"); |
} |
} |
The problem is when I click with the right mouse button, the CSS class are reseted, so the Edit button always is enable. I suppose that another javascript method executed when I press right button, but I don't know how to solve it.
Please help me.
Regards.