Browse Source

Implemented Element:SetAttribute in a way where both parameters are strings.

Nate Starkey 13 years ago
parent
commit
4d6e4ecec5
1 changed files with 4 additions and 1 deletions
  1. 4 1
      Source/Core/Lua/Element.cpp

+ 4 - 1
Source/Core/Lua/Element.cpp

@@ -202,7 +202,10 @@ int ElementScrollIntoView(lua_State* L, Element* obj)
 
 int ElementSetAttribute(lua_State* L, Element* obj)
 {
-    //do this later
+    LUACHECKOBJ(obj);
+    const char* name = luaL_checkstring(L,1);
+    const char* value = luaL_checkstring(L,2);
+    obj->SetAttribute(name,String(value));
     return 0;
 }