-
Notifications
You must be signed in to change notification settings - Fork 0
[FEATURE] Support rtl mode #4
Conversation
null, | ||
false | ||
'learnosity-items', | ||
$lrn_items_api_url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the indentation change here was checked in by accident? It looked correct before here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation before was partially not with spaces, fixed it in new commit
null, | ||
false | ||
); | ||
wp_enqueue_script( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation of this function call is wrong, so would be good to fix here thanks
$lrn_items_api_url, | ||
array(), | ||
null, | ||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to change this in_footer
variable to true? If so, how come?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, adding comment:
/*
* For items and author, in_footer is set to true. This is on purpose as the information, whether
* the read direction is right to left is set in the plugin short-code. If we loaded the scripts
* in the header, they'd be loaded before the short-code scripts are encountered, thus we
* wouldn't know whether to add the rtl flag in the src tag.
*/
true | ||
); | ||
|
||
// Before the script tags are added to page, add the rtl data attribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation wrong here, too
classes/Learnosity/Plugin.php
Outdated
} | ||
|
||
/** | ||
* Adds data-lrn-dir="rtl" to the source tag if $this->>is_rtl is true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo ->>
-> ->
public function render_items($attrs, $content) | ||
{ | ||
$items_embed = new ItemsEmbed($attrs, 'inline', $content); | ||
if (isset($attrs['rtl']) && $attrs['rtl'] === 'true') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic is repeated 4 times, ideally extract to function
LRN-28950
a29a689
to
caaa519
Compare
LRN-28950