- add sources.
[platform/framework/web/crosswalk.git] / src / native_client_sdk / src / examples / api / mouse_cursor / example.js
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 function setCursorToSelectValue() {
6   var selectEl = document.querySelector('select');
7   var cursorType = parseInt(selectEl.value, 10);
8   common.naclModule.postMessage(cursorType);
9 }
10
11 function moduleDidLoad() {
12   setCursorToSelectValue();
13 }
14
15 function attachListeners() {
16   var selectEl = document.querySelector('select');
17   selectEl.addEventListener('change', function (e) {
18     setCursorToSelectValue();
19   });
20 }