tobie (owner)

Revisions

gist: 158165 Download_button fork
public
Public Clone URL: git://gist.github.com/158165.git
Embed All Files: show embed
JavaScript #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
document.observe('click', function(event) {
  var element = event.findElement('a.quickdetails');
  if (!element) { return; }
  var href = element.readAttribute('href'),
      m = href.split('/');
  
  if (m.length < 3) { return; }
  new Ajax.Request('/VacancyInfo', {
    method: 'get',
    parameters: { id: m.last() },
    onSuccess: function(transport) {
      $modals.showVacancy({
        string: transport.responseText,
        node: element
      });
    },
    onError: function() { window.location = href; },
    onFailure: function() { window.location = href;}
  });
});