May have a back panel view of several DOM elements in the form of $ el

My web application has an editing mode in which 2 panels shift it. One on top and one on the left. Top panel with a full width and height of 20% and a side panel with the remaining height and 20% width. For this, I created a reference circuit. I usually assign a template that is the only parent div and then reference it using $ el.hide () and $ el.show ().

This case is different, so my question is that the spine has 2 patterns and somehow refers to both an identifier and something.

+4
source share
1 answer

Well, the direct answer to your question is NO. You cannot have two el associated with a view. However, you can achieve this with a different design. You should have a main view and two child views (one for the right slider and one for the left slider). Now your edit button will be placed inside the main view, then you can easily show / hide elements like this

 this.$el.find('#right-slider').toggle(); 
+3
source

Source: https://habr.com/ru/post/1480151/


All Articles