|
103 | 103 | QUnit.done(dTAjaxController.cleanup); |
104 | 104 | QUnit.config.testTimeout = 30000; |
105 | 105 | QUnit.testStart(function resetElements() { |
106 | | - var context = document.getElementById("testTableHolder"); |
107 | | - $("input[type='text']:enabled", context) |
108 | | - .each(function () { |
109 | | - if (this.value !== "") { |
110 | | - this.value = ""; |
111 | | - $(this).triggerHandler("keyup"); |
112 | | - } |
113 | | - }); |
114 | | - $("input[type='checkbox']:enabled", context) |
115 | | - .each(function () { |
116 | | - if (this.checked) { |
117 | | - this.checked = false; |
118 | | - $(this).triggerHandler("click"); |
119 | | - } |
120 | | - }); |
121 | | - $("select:enabled", context) |
122 | | - .each(function () { |
123 | | - $(this).children().filter(function (indx) { |
124 | | - return (indx == 0 || this.defaultSelected) |
125 | | - }).last() |
126 | | - .each(function () { |
127 | | - if (!this.selected) { |
128 | | - this.selected = true; |
129 | | - this.triggerHandler("change"); |
130 | | - } |
131 | | - }); |
132 | | - }); |
| 106 | + try { |
| 107 | + var context = document.getElementById("testTableHolder"); |
| 108 | + $("input[type='text']:enabled", context) |
| 109 | + .each(function () { |
| 110 | + if (this.value !== "") { |
| 111 | + this.value = ""; |
| 112 | + $(this).triggerHandler("keyup"); |
| 113 | + } |
| 114 | + }); |
| 115 | + $("input[type='checkbox']:enabled", context) |
| 116 | + .each(function () { |
| 117 | + if (this.checked) { |
| 118 | + this.checked = false; |
| 119 | + $(this).triggerHandler("click"); |
| 120 | + } |
| 121 | + }); |
| 122 | + $("select:enabled", context) |
| 123 | + .each(function () { |
| 124 | + $(this).children().filter(function (indx) { |
| 125 | + return (indx == 0 || this.defaultSelected) |
| 126 | + }).last() |
| 127 | + .each(function () { |
| 128 | + if (!this.selected) { |
| 129 | + this.selected = true; |
| 130 | + this.triggerHandler("change"); |
| 131 | + } |
| 132 | + }); |
| 133 | + }); |
| 134 | + } catch (err) { |
| 135 | + if (console && console.log) { |
| 136 | + console.log("error on executing QUnit.testStart: " + err.toString()); |
| 137 | + } |
| 138 | + } |
133 | 139 | }); |
134 | 140 |
|
135 | 141 | $(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) |
|
0 commit comments