Skip to content

Commit e4ebf10

Browse files
howlgeriloveeclipse
authored andcommitted
Modernized help UI prototype: Fix deleting and applying a search scope
This fixes the following issues in the modernized help UI prototype: - Deleting a set search scope causes JavaScript error. - Applying via search scope drop-down, choosing "Scopes...", going to the scope and hitting "Apply" does not work; as workaround a search scope can directly selected via search scope drop-down.
1 parent 2345fdf commit e4ebf10

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ua/org.eclipse.help.webapp/m/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
+ 'advanced/workingSet'
274274
+ (query ? '.jsp?' + query + '&' : 'Manager.jsp?')
275275
+ 't=' + Date.now(),
276-
function(responseText) {
276+
function(responseText, scopeIndex) {
277277
var match = SEARCH_SCOPE_NAME_PATTERN.exec(responseText);
278278
if (match) {
279279
createElement(scopesPage, 'span', 'g', '<%js:scopes_scope_field_label%>');
@@ -352,7 +352,7 @@
352352
var deleteButton = createButton(scopesPage, '<%js:scopes_scope_delete_button_label%>', '<%js:scopes_scope_delete_button_description%>', function() {
353353

354354
// if the scope to be deleted is set, unset it first
355-
if (searchScope.level == SEARCH_SCOPE_LEVEL_CUSTOM && searchScope.customIndex == scopeNr) {
355+
if (searchScope.level == SEARCH_SCOPE_LEVEL_CUSTOM && searchScope.customIndex == scopeIndex) {
356356
setSearchScope([SEARCH_SCOPE_LEVEL_ALL]);
357357
}
358358

@@ -365,7 +365,7 @@
365365
+ '&workingSet='
366366
+ encodeURIComponent(nameInput.value)
367367
+ getHrefs());
368-
setSearchScope([SEARCH_SCOPE_LEVEL_CUSTOM, scopeIndex, scopeName]);
368+
setSearchScope([SEARCH_SCOPE_LEVEL_CUSTOM, scopeName, scopeIndex]);
369369
});
370370
}
371371
createButton(scopesPage, '<%js:scopes_scope_cancel_button_label%>', '<%js:scopes_scope_cancel_button_description%>', function() { showScopesPage(); });
@@ -386,7 +386,7 @@
386386
createButton(scopesPage, '<%js:scopes_new_button_label%>', '<%js:scopes_new_button_description%>', function() { showScopesPage('operation=add'); });
387387
createButton(scopesPage, '<%js:scopes_close_button_label%>', '<%js:scopes_close_button_description%>', function() { scopesPage.s(); });
388388
}
389-
});
389+
}, 0, scopeIndex);
390390
}
391391
function doScopesOperation(query) {
392392
remoteRequest( BASE_URL
@@ -2749,10 +2749,10 @@
27492749
}
27502750

27512751
var openRequests = {};
2752-
function remoteRequest(url, callbackFn, cancelId) {
2752+
function remoteRequest(url, callbackFn, cancelId, callbackFnParam2) {
27532753
var request = new XMLHttpRequest();
27542754
if (callbackFn) request.onreadystatechange = function() {
2755-
if (request.readyState == 4 && request.status == 200) callbackFn(request.responseText);
2755+
if (request.readyState == 4 && request.status == 200) callbackFn(request.responseText, callbackFnParam2);
27562756
}
27572757
request.open('GET', url);
27582758
request.send();

0 commit comments

Comments
 (0)