Datalynx JavaScript, CSS: Różnice pomiędzy wersjami
Z MoodleDocs
Module administration
Creating an activity
Manage datalynx activities
- Views
- Fields
- Filter, Search and Sort
- Datalynx Tags
- Statistics
- Notifications
- JavaScript, CSS
- Calculations
See also
Created page with "{{Datalynx}} It is possible to add custom JavaScript and CSS code to a datalynx activity. == JavaScript == If you use JavaScript, make sure to choose appropriate selectors a..." |
|||
| Linia 3: | Linia 3: | ||
== JavaScript == | == JavaScript == | ||
If you use JavaScript, make sure to choose appropriate selectors and classes, in order to only target the specific view where the JS should be used. Also make sure to make a difference between editing mode and view mode of a view. In the following example, the edit view is detected via the presence of an input-tag, that is not present in view mode. | You can add custom JavaScript in "Manage -> JavaScript". If you use JavaScript, make sure to choose appropriate selectors and classes, in order to only target the specific view where the JS should be used. Also make sure to make a difference between editing mode and view mode of a view. In the following example, the edit view is detected via the presence of an input-tag, that is not present in view mode. | ||
<code javascript> | <code javascript> | ||
Wersja z 22:50, 4 maj 2014
It is possible to add custom JavaScript and CSS code to a datalynx activity.
JavaScript
You can add custom JavaScript in "Manage -> JavaScript". If you use JavaScript, make sure to choose appropriate selectors and classes, in order to only target the specific view where the JS should be used. Also make sure to make a difference between editing mode and view mode of a view. In the following example, the edit view is detected via the presence of an input-tag, that is not present in view mode.
YUI().use('node', 'event', function(Y) {
if(Y.one('.class_only_present_in_a_view') && Y.one('.sws input')){
function werteberechnen(){
var einzel = Y.all('.summeects');
}
}
});
CSS
Add custom CSS in "Manage -> CSS"