Maxim Kulkin
Posts: 58
Nickname: hapk
Registered: Sep, 2006
Maxim Kulkin is developer in Selectosa Systems.
|
|
|
|
IF/UNLESS ���������� �� RJS ����������������
|
Posted: Oct 2, 2006 6:54 AM
|
|
Advertisement
|
���������������� �������������� ���������������������������������� �� Ajax �� Rails �������������� �� ���������������� ���������� ������ ������������������ ���������������� IF ������������ �� javascript'��. ���������������� �������� (������������ �������������� �� �������� ����������) - ������������������ ��������������-������������:
page.if page['element_id'].visible do page['element_id'].hide end
���������������� �� ������, ������ page['element_id'].visible ���������������� ������ ���� ��������, ������ ���������� ���������������� �� IF ��������. ���������� ���������� ������������������������ ���������� ������������������������ ������������:
page.unless "$('element_id').visible()" do page['element_id'].show end
�������� ������ ���������������� �� core, ���� �������� �������������������� �������������� �������������� ������ ��������������.
��������������������, ������ �� ����: http://rubyforge.org/projects/js-if-blocks. �������������������������� ���������� ������:
./script/plugin install http://rubyforge.org/projects/js-if-blocks/trunk/js-if-blocks
���������� ���������� �� �������������������� ���������������������� �������������������� �������������������������� proxy ����������������, ����������������:
element = page['element_id] page.if element.visible do element.hide end
Read: IF/UNLESS ���������� �� RJS ����������������
|
|