Esempio n. 1
0
/**
 * blur - this method removes the focus from this element
 *
 * params - none
 * return - void
 */
JSBool jhtml_input_blur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
	HTMLElement *pElem = (HTMLElement *) jhutil_GetPrivate(cx, obj);

	if (!pElem)
	{
		return JS_TRUE;
	}
	HTMLDocument *pDoc = (pElem)? pElem->GetDocument() : 0;
	if (pDoc && pDoc->Body())
	{
		pDoc->Body()->Focus();
	}
	*rval = JSVAL_VOID;
	return JS_TRUE;
}
Esempio n. 2
0
/**
 * blur - This method removes the focus from this element
 *
 * params - none;
 * return - void;
 */
JSBool jhtml_anchor_blur(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
{
	LOG_HTMLDOM("jhtml_anchor_blur\n");

	if (JS_GetClass(obj) == &JSHtmlAnchorElement)
	{
		HTMLElement *pElem = (HTMLElement *) jhutil_GetPrivate(cx, obj);

		if (!pElem)
		{
			return JS_TRUE;
		}

		HTMLDocument *pDoc = (pElem)? pElem->GetDocument() : 0;
		if (pDoc && pDoc->Body())
		{
			pDoc->Body()->Focus();
		}
	}

	*rval = JSVAL_VOID;
	return JS_TRUE;
}