mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 16:22:53 +00:00
Only let left btn clicks through for popping up the dialog
b=49904 r=kmcclusk
This commit is contained in:
parent
18d89a1b76
commit
412b9b55f7
@ -53,6 +53,7 @@
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIFilePicker.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
@ -236,6 +237,18 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
|
||||
nsresult
|
||||
nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
// only allow the left button
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
|
||||
if (mouseEvent) {
|
||||
PRUint16 whichButton;
|
||||
if (NS_SUCCEEDED(mouseEvent->GetButton(&whichButton))) {
|
||||
if (whichButton != 1) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult result;
|
||||
|
||||
// Get parent nsIDOMWindow object.
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIFilePicker.h"
|
||||
#include "nsIDOMMouseEvent.h"
|
||||
|
||||
|
||||
static NS_DEFINE_IID(kIFormControlFrameIID, NS_IFORMCONTROLFRAME_IID);
|
||||
@ -236,6 +237,18 @@ nsFileControlFrame::ScrollIntoView(nsIPresContext* aPresContext)
|
||||
nsresult
|
||||
nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent)
|
||||
{
|
||||
// only allow the left button
|
||||
nsCOMPtr<nsIDOMMouseEvent> mouseEvent = do_QueryInterface(aMouseEvent);
|
||||
if (mouseEvent) {
|
||||
PRUint16 whichButton;
|
||||
if (NS_SUCCEEDED(mouseEvent->GetButton(&whichButton))) {
|
||||
if (whichButton != 1) {
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nsresult result;
|
||||
|
||||
// Get parent nsIDOMWindow object.
|
||||
|
Loading…
x
Reference in New Issue
Block a user